From e7ea97039d0752b53703debce800281e55efa801 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 27 Oct 2013 10:02:26 +0100 Subject: [PATCH 1/4] ptx: stop using deprecated avcodec_set_dimensions --- libavcodec/ptx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavcodec/ptx.c b/libavcodec/ptx.c index 527e39acc6..76fff26bb6 100644 --- a/libavcodec/ptx.c +++ b/libavcodec/ptx.c @@ -55,10 +55,9 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, buf += offset; - if ((ret = av_image_check_size(w, h, 0, avctx)) < 0) + if ((ret = ff_set_dimensions(avctx, w, h)) < 0) return ret; - if (w != avctx->width || h != avctx->height) - avcodec_set_dimensions(avctx, w, h); + if ((ret = ff_get_buffer(avctx, p, 0)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; From ce9f5b13ed1eb1882479574c12af24cf0e2b8aaf Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 27 Oct 2013 10:02:26 +0100 Subject: [PATCH 2/4] rv10: stop using deprecated avcodec_set_dimensions --- libavcodec/rv10.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index f790c1fa9e..f80625a891 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -28,6 +28,7 @@ #include "libavutil/imgutils.h" #include "avcodec.h" #include "error_resilience.h" +#include "internal.h" #include "mpegvideo.h" #include "mpeg4video.h" #include "h263.h" @@ -358,10 +359,12 @@ static int rv20_decode_picture_header(RVDecContext *rv) if (new_w != s->width || new_h != s->height) { av_log(s->avctx, AV_LOG_DEBUG, "attempting to change resolution to %dx%d\n", new_w, new_h); - if (av_image_check_size(new_w, new_h, 0, s->avctx) < 0) - return AVERROR_INVALIDDATA; ff_MPV_common_end(s); - avcodec_set_dimensions(s->avctx, new_w, new_h); + + ret = ff_set_dimensions(s->avctx, new_w, new_h); + if (ret < 0) + return ret; + s->width = new_w; s->height = new_h; if ((ret = ff_MPV_common_init(s)) < 0) From 1d389e2a801ffabcfe86a2bb5b3d4b18b40d841c Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 27 Oct 2013 10:02:26 +0100 Subject: [PATCH 3/4] rv34: stop using deprecated avcodec_set_dimensions --- libavcodec/rv34.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c index 7eb97e7083..8038f8f232 100644 --- a/libavcodec/rv34.c +++ b/libavcodec/rv34.c @@ -1667,7 +1667,11 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, s->width = si.width; s->height = si.height; - avcodec_set_dimensions(s->avctx, s->width, s->height); + + err = ff_set_dimensions(s->avctx, s->width, s->height); + if (err < 0) + return err; + if ((err = ff_MPV_common_frame_size_change(s)) < 0) return err; if ((err = rv34_decoder_realloc(r)) < 0) From c755870d52c8c29676e5ba7ee9557adf4a7ca934 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 27 Oct 2013 10:02:26 +0100 Subject: [PATCH 4/4] sgidec: stop using deprecated avcodec_set_dimensions --- libavcodec/sgidec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/sgidec.c b/libavcodec/sgidec.c index 476311d03a..928806f1bb 100644 --- a/libavcodec/sgidec.c +++ b/libavcodec/sgidec.c @@ -200,9 +200,9 @@ static int decode_frame(AVCodecContext *avctx, return -1; } - if (av_image_check_size(s->width, s->height, 0, avctx)) - return -1; - avcodec_set_dimensions(avctx, s->width, s->height); + ret = ff_set_dimensions(avctx, s->width, s->height); + if (ret < 0) + return ret; if (ff_get_buffer(avctx, p, 0) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed.\n");