diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-03-01 23:24:37 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-03-03 11:40:40 +0100 |
commit | 53d739db4e528388fae89459e887a633ffbce12c (patch) | |
tree | 1bd5f1e0e7a91f95011ce87de08716d983629445 /libavcodec/alsdec.c | |
parent | 6cc3ba4be64caa9c402740cd0b2c9b91bbb2cfe8 (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>
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 b3c444c54f..a8c3433fa8 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -1016,6 +1016,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); |