]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/scpr.c
avcodec/scpr: Check minimum size of type 17
[ffmpeg] / libavcodec / scpr.c
index ab4d5b57df75eee5691a2ac732347bb20c978c78..2a0ebcecfcd3938d3ea40f2c97cc2fbccb6a6f1c 100644 (file)
@@ -534,6 +534,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         uint32_t clr, *dst = (uint32_t *)s->current_frame->data[0];
         int y;
 
+        if (bytestream2_get_bytes_left(gb) < 3)
+            return AVERROR_INVALIDDATA;
+
         frame->key_frame = 1;
         bytestream2_skip(gb, 1);
         if (avctx->bits_per_coded_sample == 16) {