]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/magicyuv: check dimensions
authorPaul B Mahol <onemda@gmail.com>
Sun, 19 Jun 2016 07:43:22 +0000 (09:43 +0200)
committerPaul B Mahol <onemda@gmail.com>
Sun, 19 Jun 2016 07:45:29 +0000 (09:45 +0200)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavcodec/magicyuv.c

index cd703e7c8a918356a613b216b2726ee3a02ed90d..ce0ea9b84a4fe2ae6c384388a3e1885aaca7a994 100644 (file)
@@ -309,8 +309,9 @@ static int decode_frame(AVCodecContext *avctx,
     s->interlaced = !!(bytestream2_get_byte(&gb) & 2);
     bytestream2_skip(&gb, 3);
 
-    avctx->coded_width  = bytestream2_get_le32(&gb);
-    avctx->coded_height = bytestream2_get_le32(&gb);
+    if ((ret = ff_set_dimensions(avctx, bytestream2_get_le32(&gb), bytestream2_get_le32(&gb))) < 0)
+        return ret;
+
     slice_width = bytestream2_get_le32(&gb);
     if (slice_width != avctx->coded_width) {
         avpriv_request_sample(avctx, "unsupported slice width: %d", slice_width);