]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/notchlc.c
avcodec: Constify AVCodecs
[ffmpeg] / libavcodec / notchlc.c
index 57ce70e9451d5635e22d5edc1becb57055d6f516..c109c5f6f313c9515522b304ff236b5cf8a50617 100644 (file)
@@ -496,6 +496,9 @@ static int decode_frame(AVCodecContext *avctx,
 
         bytestream2_init(gb, s->lzf_buffer, uncompressed_size);
     } else if (s->format == 1) {
+        if (bytestream2_get_bytes_left(gb) < uncompressed_size / 255)
+            return AVERROR_INVALIDDATA;
+
         av_fast_padded_malloc(&s->uncompressed_buffer, &s->uncompressed_size,
                               uncompressed_size);
         if (!s->uncompressed_buffer)
@@ -534,7 +537,7 @@ static av_cold int decode_end(AVCodecContext *avctx)
     return 0;
 }
 
-AVCodec ff_notchlc_decoder = {
+const AVCodec ff_notchlc_decoder = {
     .name             = "notchlc",
     .long_name        = NULL_IF_CONFIG_SMALL("NotchLC"),
     .type             = AVMEDIA_TYPE_VIDEO,