Fixes: left shift of negative value -1 Fixes: 15719/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5685731105701888
Unified · Split
| @@ -657,7 +657,7 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd) · 656 unmodified lines | ||
| 657 | 657 | |
| 658 | 658 | // do not continue in case of a damaged stream since |
| 659 | 659 | // block_length must be evenly divisible by sub_blocks |
| 660 | − if (bd->block_length & (sub_blocks - 1)) { | |
| 660 | + if (bd->block_length & (sub_blocks - 1) || bd->block_length <= 0) { | |
| 661 | 661 | av_log(avctx, AV_LOG_WARNING, |
| 662 | 662 | "Block length is not evenly divisible by the number of subblocks.\n"); |
| 663 | 663 | return AVERROR_INVALIDDATA; |