avcodec/pictordec: run av_image_check_size() unconditionally
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 3 Sep 2013 19:45:25 +0000 (21:45 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 3 Sep 2013 23:02:06 +0000 (01:02 +0200)
This ensures that no invalid size leaks through
(This issue is hypothetical, ive no testcase)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/pictordec.c

index df3380d..a6ecd99 100644 (file)
@@ -140,9 +140,9 @@ static int decode_frame(AVCodecContext *avctx,
 
     avctx->pix_fmt = AV_PIX_FMT_PAL8;
 
+    if (av_image_check_size(s->width, s->height, 0, avctx) < 0)
+        return -1;
     if (s->width != avctx->width && s->height != avctx->height) {
-        if (av_image_check_size(s->width, s->height, 0, avctx) < 0)
-            return -1;
         avcodec_set_dimensions(avctx, s->width, s->height);
     }