aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/alsdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-07-26 15:26:08 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-11 20:18:47 +0100
commit56a24691045de60a6ff7284aa793fa9e862c09ac (patch)
tree5f40338d54966ae37e74fdf2dd1ebe238510fc60 /libavcodec/alsdec.c
parentce2caf5674c3adbab01635ed4535cbc208930a8e (diff)
downloadffmpeg-56a24691045de60a6ff7284aa793fa9e862c09ac.tar.gz
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 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit be4fb282f9fb00d9c267dcc477745e2e468e758f) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/alsdec.c')
-rw-r--r--libavcodec/alsdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 6b5774175b..d4451482a4 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -657,7 +657,7 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
// do not continue in case of a damaged stream since
// block_length must be evenly divisible by sub_blocks
- if (bd->block_length & (sub_blocks - 1)) {
+ if (bd->block_length & (sub_blocks - 1) || bd->block_length <= 0) {
av_log(avctx, AV_LOG_WARNING,
"Block length is not evenly divisible by the number of subblocks.\n");
return AVERROR_INVALIDDATA;