avcodec/diracdec: Check ff_set_dimensions() for failure
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 17 Dec 2015 16:02:14 +0000 (17:02 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 17 Dec 2015 18:00:33 +0000 (19:00 +0100)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/diracdec.c

index f35fe45..486c1b3 100644 (file)
@@ -1989,7 +1989,12 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
             return ret;
         }
 
-        ff_set_dimensions(avctx, dsh->width, dsh->height);
+        ret = ff_set_dimensions(avctx, dsh->width, dsh->height);
+        if (ret < 0) {
+            av_freep(&dsh);
+            return ret;
+        }
+
         ff_set_sar(avctx, dsh->sample_aspect_ratio);
         avctx->pix_fmt         = dsh->pix_fmt;
         avctx->color_range     = dsh->color_range;