diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-09-08 21:08:31 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-01-06 11:30:43 +0100 |
commit | e6cff05befb185642f4cd6d98e88faf076930ff5 (patch) | |
tree | 5d184d59ae8444d5e4fe82c8e75ce3af7cf21dab | |
parent | 5d49cf9ac2f0ef27a9acb897ab8363300e41c59d (diff) | |
download | ffmpeg-e6cff05befb185642f4cd6d98e88faf076930ff5.tar.gz |
avcodec/aacdec: Check if we run out of input in read_stream_mux_config()
Fixes: Infinite loop
Fixes: 16920/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5653421289373696
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 3dce4d03d5a555bff2e11f97fb54701b22effeaf)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/aacdec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index 758c89e107..cc97ff4389 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -411,6 +411,8 @@ static int read_stream_mux_config(struct LATMContext *latmctx, } else { int esc; do { + if (get_bits_left(gb) < 9) + return AVERROR_INVALIDDATA; esc = get_bits(gb, 1); skip_bits(gb, 8); } while (esc); |