diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index 223f3f94f5..a9740699f6 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -1480,6 +1480,9 @@ static int read_diff_float_data(ALSDecContext *ctx, unsigned int ra_frame) { ff_mlz_flush_dict(ctx->mlz); } + if (avctx->channels * 8 > get_bits_left(gb)) + return AVERROR_INVALIDDATA; + for (c = 0; c < avctx->channels; ++c) { if (use_acf) { //acf_flag