]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/alsdec.c
avcodec: Constify AVCodecs
[ffmpeg] / libavcodec / alsdec.c
index b3c444c54f4a601d48724626c0a1f4d789fe561f..0aada774508135844c0f979b3906ed4cd6ad7be5 100644 (file)
@@ -1016,6 +1016,10 @@ static int read_block(ALSDecContext *ctx, ALSBlockData *bd)
     ALSSpecificConfig *sconf = &ctx->sconf;
 
     *bd->shift_lsbs = 0;
+
+    if (get_bits_left(gb) < 1)
+        return AVERROR_INVALIDDATA;
+
     // read block type flag and read the samples accordingly
     if (get_bits1(gb)) {
         ret = read_var_block_data(ctx, bd);
@@ -2169,7 +2173,7 @@ static av_cold void flush(AVCodecContext *avctx)
 }
 
 
-AVCodec ff_als_decoder = {
+const AVCodec ff_als_decoder = {
     .name           = "als",
     .long_name      = NULL_IF_CONFIG_SMALL("MPEG-4 Audio Lossless Coding (ALS)"),
     .type           = AVMEDIA_TYPE_AUDIO,