aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-03-01 23:24:37 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-11 21:23:49 +0200
commita3cac14fb92075cb9385c35bcd5b2a619ac968d1 (patch)
tree2f608d4f2f3b5a35bfc8b72cc580e4de156bd57c /libavcodec
parent07b08082f023c7e373e8324617d515dd08339795 (diff)
downloadffmpeg-a3cac14fb92075cb9385c35bcd5b2a619ac968d1.tar.gz
avcodec/alsdec: Check bitstream input in read_block()
Fixes: Timeout Fixes: 28110/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5036338973507584 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 53d739db4e528388fae89459e887a633ffbce12c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/alsdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 8a8f82fb85..4511eec424 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1020,6 +1020,10 @@ static int read_block(ALSDecContext *ctx, ALSBlockData *bd)
ALSSpecificConfig *sconf = &ctx->sconf;
*bd->shift_lsbs = 0;
+
+ if (get_bits_left(gb) < 1)
+ return AVERROR_INVALIDDATA;
+
// read block type flag and read the samples accordingly
if (get_bits1(gb)) {
ret = read_var_block_data(ctx, bd);