]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/fmvc.c
avutil/pixdesc: Remove deprecated AV_PIX_FMT_FLAG_PSEUDOPAL
[ffmpeg] / libavcodec / fmvc.c
index 5778d7b53f8472fcae76601513b338812ebf72f1..3701b0849b79c48a26fbd34a83fe80ecb0092f66 100644 (file)
@@ -402,6 +402,9 @@ static int decode_frame(AVCodecContext *avctx, void *data,
     AVFrame *frame = data;
     int ret, y, x;
 
+    if (avpkt->size < 8)
+        return AVERROR_INVALIDDATA;
+
     if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
         return ret;
 
@@ -437,6 +440,8 @@ static int decode_frame(AVCodecContext *avctx, void *data,
             memcpy(dst, src, avctx->width * s->bpp);
             dst -= frame->linesize[0];
             src += s->stride * 4;
+            if (bytestream2_tell_p(pb) < y*s->stride * 4)
+                break;
         }
     } else {
         unsigned block, nb_blocks;