diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-03-02 01:24:37 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-10-17 22:34:53 +0300 |
commit | f3a01b3543e6f618a65bdf3969764b00790697de (patch) | |
tree | 10b1bd9b219b1cc20dcac2ed082ca214b10e3baf /libavcodec/alsdec.c | |
parent | f5ed37fd0b8d17d886312dfba7fac0cfdbda5864 (diff) |
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/alsdec.c')
-rw-r--r-- | libavcodec/alsdec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index 972271e2e9..e8b95c56eb 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -1012,6 +1012,10 @@ static int read_block(ALSDecContext *ctx, ALSBlockData *bd) GetBitContext *gb = &ctx->gb; *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); |