* commit 'c755870d52c8c29676e5ba7ee9557adf4a7ca934':
sgidec: stop using deprecated avcodec_set_dimensions
rv34: stop using deprecated avcodec_set_dimensions
rv10: stop using deprecated avcodec_set_dimensions
ptx: stop using deprecated avcodec_set_dimensions
Conflicts:
libavcodec/ptx.c
libavcodec/rv10.c
libavcodec/sgidec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
... | ... |
@@ -55,10 +55,9 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, |
55 | 55 |
|
56 | 56 |
buf += offset; |
57 | 57 |
|
58 |
- if ((ret = av_image_check_size(w, h, 0, avctx)) < 0) |
|
58 |
+ if ((ret = ff_set_dimensions(avctx, w, h)) < 0) |
|
59 | 59 |
return ret; |
60 |
- if (w != avctx->width || h != avctx->height) |
|
61 |
- avcodec_set_dimensions(avctx, w, h); |
|
60 |
+ |
|
62 | 61 |
if ((ret = ff_get_buffer(avctx, p, 0)) < 0) |
63 | 62 |
return ret; |
64 | 63 |
|
... | ... |
@@ -28,6 +28,7 @@ |
28 | 28 |
#include "libavutil/imgutils.h" |
29 | 29 |
#include "avcodec.h" |
30 | 30 |
#include "error_resilience.h" |
31 |
+#include "internal.h" |
|
31 | 32 |
#include "mpegvideo.h" |
32 | 33 |
#include "mpeg4video.h" |
33 | 34 |
#include "h263.h" |
... | ... |
@@ -363,8 +364,6 @@ static int rv20_decode_picture_header(RVDecContext *rv) |
363 | 363 |
AVRational old_aspect = s->avctx->sample_aspect_ratio; |
364 | 364 |
av_log(s->avctx, AV_LOG_DEBUG, |
365 | 365 |
"attempting to change resolution to %dx%d\n", new_w, new_h); |
366 |
- if (av_image_check_size(new_w, new_h, 0, s->avctx) < 0) |
|
367 |
- return AVERROR_INVALIDDATA; |
|
368 | 366 |
ff_MPV_common_end(s); |
369 | 367 |
|
370 | 368 |
// attempt to keep aspect during typical resolution switches |
... | ... |
@@ -374,7 +373,11 @@ static int rv20_decode_picture_header(RVDecContext *rv) |
374 | 374 |
s->avctx->sample_aspect_ratio = av_mul_q(old_aspect, (AVRational){2, 1}); |
375 | 375 |
if (new_w * s->height == 2 * new_h * s->width) |
376 | 376 |
s->avctx->sample_aspect_ratio = av_mul_q(old_aspect, (AVRational){1, 2}); |
377 |
- avcodec_set_dimensions(s->avctx, new_w, new_h); |
|
377 |
+ |
|
378 |
+ ret = ff_set_dimensions(s->avctx, new_w, new_h); |
|
379 |
+ if (ret < 0) |
|
380 |
+ return ret; |
|
381 |
+ |
|
378 | 382 |
s->width = new_w; |
379 | 383 |
s->height = new_h; |
380 | 384 |
if ((ret = ff_MPV_common_init(s)) < 0) |
... | ... |
@@ -1693,7 +1693,11 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, |
1693 | 1693 |
si.width, si.height); |
1694 | 1694 |
s->width = si.width; |
1695 | 1695 |
s->height = si.height; |
1696 |
- avcodec_set_dimensions(s->avctx, s->width, s->height); |
|
1696 |
+ |
|
1697 |
+ err = ff_set_dimensions(s->avctx, s->width, s->height); |
|
1698 |
+ if (err < 0) |
|
1699 |
+ return err; |
|
1700 |
+ |
|
1697 | 1701 |
if ((err = ff_MPV_common_frame_size_change(s)) < 0) |
1698 | 1702 |
return err; |
1699 | 1703 |
if ((err = rv34_decoder_realloc(r)) < 0) |
... | ... |
@@ -202,9 +202,9 @@ static int decode_frame(AVCodecContext *avctx, |
202 | 202 |
return AVERROR_INVALIDDATA; |
203 | 203 |
} |
204 | 204 |
|
205 |
- if (av_image_check_size(s->width, s->height, 0, avctx)) |
|
206 |
- return AVERROR_INVALIDDATA; |
|
207 |
- avcodec_set_dimensions(avctx, s->width, s->height); |
|
205 |
+ ret = ff_set_dimensions(avctx, s->width, s->height); |
|
206 |
+ if (ret < 0) |
|
207 |
+ return ret; |
|
208 | 208 |
|
209 | 209 |
if ((ret = ff_get_buffer(avctx, p, 0)) < 0) |
210 | 210 |
return ret; |