]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/exr: stop using deprecated avcodec_set_dimensions()
authorPaul B Mahol <onemda@gmail.com>
Fri, 1 Nov 2013 15:29:20 +0000 (15:29 +0000)
committerPaul B Mahol <onemda@gmail.com>
Fri, 1 Nov 2013 19:05:35 +0000 (19:05 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavcodec/exr.c

index ef4fc36c6094c8aac2f5bea7e266cb1d74d84520..f231b7037509319242b770de3947d66d2f75d2ec 100644 (file)
@@ -35,6 +35,7 @@
 #include "get_bits.h"
 #include "avcodec.h"
 #include "bytestream.h"
+#include "internal.h"
 #include "mathops.h"
 #include "thread.h"
 #include "libavutil/imgutils.h"
@@ -1184,9 +1185,6 @@ static int decode_frame(AVCodecContext *avctx,
         return AVERROR_PATCHWELCOME;
     }
 
-    if (av_image_check_size(w, h, 0, avctx))
-        return AVERROR_INVALIDDATA;
-
     // Verify the xmin, xmax, ymin, ymax and xdelta before setting the actual image size
     if (s->xmin > s->xmax ||
         s->ymin > s->ymax ||
@@ -1196,9 +1194,8 @@ static int decode_frame(AVCodecContext *avctx,
         return AVERROR_INVALIDDATA;
     }
 
-    if (w != avctx->width || h != avctx->height) {
-        avcodec_set_dimensions(avctx, w, h);
-    }
+    if ((ret = ff_set_dimensions(avctx, w, h)) < 0)
+        return ret;
 
     s->desc = av_pix_fmt_desc_get(avctx->pix_fmt);
     out_line_size = avctx->width * 2 * s->desc->nb_components;