From 317d6a150392c96238d5e124524b12ba340f36e6 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 27 Oct 2013 10:02:26 +0100 Subject: [PATCH 1/4] indeo3: stop using deprecated avcodec_set_dimensions --- libavcodec/indeo3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c index 7cc870d5a0..a9c02b2889 100644 --- a/libavcodec/indeo3.c +++ b/libavcodec/indeo3.c @@ -944,7 +944,7 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx, free_frame_buffers(ctx); if ((res = allocate_frame_buffers(ctx, avctx)) < 0) return res; - avcodec_set_dimensions(avctx, width, height); + ff_set_dimensions(avctx, width, height); } y_offset = bytestream2_get_le32(&gb); From d184cd1dacf0997687c1ce9d82e9bbbcea1102ac Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 27 Oct 2013 10:02:26 +0100 Subject: [PATCH 2/4] ivi_common: stop using deprecated avcodec_set_dimensions --- libavcodec/ivi_common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c index 7ca53b7b0d..8c5d7f32c3 100644 --- a/libavcodec/ivi_common.c +++ b/libavcodec/ivi_common.c @@ -1015,7 +1015,10 @@ int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, av_log(avctx, AV_LOG_ERROR, "Buffer contains IP frames!\n"); } - avcodec_set_dimensions(avctx, ctx->planes[0].width, ctx->planes[0].height); + result = ff_set_dimensions(avctx, ctx->planes[0].width, ctx->planes[0].height); + if (result < 0) + return result; + if ((result = ff_get_buffer(avctx, frame, 0)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return result; From d62b24a3f6bfd541704b258d8495eac58d8866dd Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 27 Oct 2013 10:02:26 +0100 Subject: [PATCH 3/4] kgv1dec: stop using deprecated avcodec_set_dimensions --- libavcodec/kgv1dec.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libavcodec/kgv1dec.c b/libavcodec/kgv1dec.c index 1774f36c3b..62b5c6e233 100644 --- a/libavcodec/kgv1dec.c +++ b/libavcodec/kgv1dec.c @@ -61,12 +61,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, h = (buf[1] + 1) * 8; buf += 2; - if ((res = av_image_check_size(w, h, 0, avctx)) < 0) - return res; - if (w != avctx->width || h != avctx->height) { av_frame_unref(&c->prev); - avcodec_set_dimensions(avctx, w, h); + if ((res = ff_set_dimensions(avctx, w, h)) < 0) + return res; } maxcnt = w * h; From 967cd6fafbf2fdec9cbe011296ad34a70212427e Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 27 Oct 2013 10:02:26 +0100 Subject: [PATCH 4/4] libopenjpegdec: stop using deprecated avcodec_set_dimensions --- libavcodec/libopenjpegdec.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c index 006270108d..d6fca33a85 100644 --- a/libavcodec/libopenjpegdec.c +++ b/libavcodec/libopenjpegdec.c @@ -33,6 +33,7 @@ #include "libavutil/pixfmt.h" #include "libavutil/opt.h" #include "avcodec.h" +#include "internal.h" #include "thread.h" #define JP2_SIG_TYPE 0x6A502020 @@ -315,13 +316,9 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx, height = (height + (1 << ctx->lowres) - 1) >> ctx->lowres; } - if ((ret = av_image_check_size(width, height, 0, avctx)) < 0) { - av_log(avctx, AV_LOG_ERROR, - "%dx%d dimension invalid.\n", width, height); + ret = ff_set_dimensions(avctx, width, height); + if (ret < 0) goto done; - } - - avcodec_set_dimensions(avctx, width, height); if (avctx->pix_fmt != AV_PIX_FMT_NONE) if (!libopenjpeg_matches_pix_fmt(image, avctx->pix_fmt))