From 9c0ece1b4f3f5e88c90883085d6bbc7eb0309314 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 27 Oct 2013 10:02:26 +0100 Subject: [PATCH 1/4] sunrast: stop using deprecated avcodec_set_dimensions --- libavcodec/sunrast.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libavcodec/sunrast.c b/libavcodec/sunrast.c index 4147cf0b82..ffa685c19f 100644 --- a/libavcodec/sunrast.c +++ b/libavcodec/sunrast.c @@ -61,10 +61,6 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data, av_log(avctx, AV_LOG_ERROR, "invalid (compression) type\n"); return AVERROR_INVALIDDATA; } - if (av_image_check_size(w, h, 0, avctx)) { - av_log(avctx, AV_LOG_ERROR, "invalid image size\n"); - return AVERROR_INVALIDDATA; - } if (maptype == RMT_RAW) { avpriv_request_sample(avctx, "Unknown colormap type"); return AVERROR_PATCHWELCOME; @@ -90,8 +86,10 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data, return AVERROR_INVALIDDATA; } - if (w != avctx->width || h != avctx->height) - avcodec_set_dimensions(avctx, w, h); + ret = ff_set_dimensions(avctx, w, h); + if (ret < 0) + return ret; + if ((ret = ff_get_buffer(avctx, p, 0)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; From 7fbb75cc701af9bfcaac21afecdb22e5e5efd528 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 27 Oct 2013 10:02:26 +0100 Subject: [PATCH 2/4] svq1dec: stop using deprecated avcodec_set_dimensions --- libavcodec/svq1dec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c index 7d3ef50db8..3b1a275bf4 100644 --- a/libavcodec/svq1dec.c +++ b/libavcodec/svq1dec.c @@ -638,7 +638,10 @@ static int svq1_decode_frame(AVCodecContext *avctx, void *data, av_dlog(avctx, "Error in svq1_decode_frame_header %i\n", result); return result; } - avcodec_set_dimensions(avctx, s->width, s->height); + + result = ff_set_dimensions(avctx, s->width, s->height); + if (result < 0) + return result; if ((avctx->skip_frame >= AVDISCARD_NONREF && s->nonref) || (avctx->skip_frame >= AVDISCARD_NONKEY && From eed5a478ba1bd41b01b1144959ac5f1889238b43 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 27 Oct 2013 10:02:26 +0100 Subject: [PATCH 3/4] targa: stop using deprecated avcodec_set_dimensions --- libavcodec/targa.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavcodec/targa.c b/libavcodec/targa.c index 9f0b286813..f077c03d65 100644 --- a/libavcodec/targa.c +++ b/libavcodec/targa.c @@ -142,10 +142,9 @@ static int decode_frame(AVCodecContext *avctx, return AVERROR_INVALIDDATA; } - 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 c265b8bb7638546919465e3585441b1d40c4b13d Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 27 Oct 2013 10:02:26 +0100 Subject: [PATCH 4/4] tiff: stop using deprecated avcodec_set_dimensions --- libavcodec/tiff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 735eafe721..7fb0e7a3a6 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -296,9 +296,9 @@ static int init_image(TiffContext *s, AVFrame *frame) return AVERROR_INVALIDDATA; } if (s->width != s->avctx->width || s->height != s->avctx->height) { - if ((ret = av_image_check_size(s->width, s->height, 0, s->avctx)) < 0) + ret = ff_set_dimensions(s->avctx, s->width, s->height); + if (ret < 0) return ret; - avcodec_set_dimensions(s->avctx, s->width, s->height); } if ((ret = ff_get_buffer(s->avctx, frame, 0)) < 0) { av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");