diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index b87cb12567..2cafce8cb3 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -1659,7 +1659,8 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame) if (!sconf->mc_coding || ctx->js_switch) { int independent_bs = !sconf->joint_stereo; - + if (get_bits_left(gb) < 7*channels*ctx->num_blocks) + return AVERROR_INVALIDDATA; for (c = 0; c < channels; c++) { js_blocks[0] = 0; js_blocks[1] = 0;