History

avcodec/alsdec: Check for block_length <= 0 in read_var_block_data()

Fixes: left shift of negative value -1 Fixes: 15719/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5685731105701888

Michael Niedermayer committed 7 years ago

Commit be4fb281 parent 02f909d1 file · +1 −1Browse files

Unified · Split

libavcodec/alsdec.c+1−1
@@ -657,7 +657,7 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd) · 656 unmodified lines
657 657
658 // do not continue in case of a damaged stream since658 // do not continue in case of a damaged stream since
659 // block_length must be evenly divisible by sub_blocks659 // 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 av_log(avctx, AV_LOG_WARNING,661 av_log(avctx, AV_LOG_WARNING,
662 "Block length is not evenly divisible by the number of subblocks.\n");662 "Block length is not evenly divisible by the number of subblocks.\n");
663 return AVERROR_INVALIDDATA;663 return AVERROR_INVALIDDATA;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t