]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/rasc.c
avcodec/cri: Stop the bitreader at the end of uncompressed input
[ffmpeg] / libavcodec / rasc.c
index 21fc43f325c761a8f0fec0cd5b87d9baaa75f9e4..706940bf5f4c1f69a55e87c332f3972f82ff6d14 100644 (file)
@@ -70,6 +70,9 @@ static void clear_plane(AVCodecContext *avctx, AVFrame *frame)
     RASCContext *s = avctx->priv_data;
     uint8_t *dst = frame->data[0];
 
+    if (!dst)
+        return;
+
     for (int y = 0; y < avctx->height; y++) {
         memset(dst, 0, avctx->width * s->bpp);
         dst += frame->linesize[0];
@@ -124,6 +127,8 @@ static int decode_fint(AVCodecContext *avctx,
         clear_plane(avctx, s->frame1);
         return 0;
     }
+    if (bytestream2_get_bytes_left(gb) < 72)
+        return AVERROR_INVALIDDATA;
 
     bytestream2_skip(gb, 8);
     w = bytestream2_get_le32(gb);