]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/scpr.c
avcodec: Constify AVCodecs
[ffmpeg] / libavcodec / scpr.c
index ab4d5b57df75eee5691a2ac732347bb20c978c78..ba6e849c66ee60d57ee6f434af2bda7ef67711ce 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) {
@@ -664,7 +667,7 @@ static av_cold int decode_close(AVCodecContext *avctx)
     return 0;
 }
 
-AVCodec ff_scpr_decoder = {
+const AVCodec ff_scpr_decoder = {
     .name             = "scpr",
     .long_name        = NULL_IF_CONFIG_SMALL("ScreenPressor"),
     .type             = AVMEDIA_TYPE_VIDEO,