aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-09-08 21:08:31 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-01 12:49:26 +0200
commit8527e9702cf1ed7c5582c3f8e6c17c6fc7e256cd (patch)
tree9d8a7b5b25959c25dc292ea00c843408a1aa0ff1
parent0571e85e427081f7627fbd63427e38e94f83f6b3 (diff)
downloadffmpeg-8527e9702cf1ed7c5582c3f8e6c17c6fc7e256cd.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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 3d398a4360..2132420cc1 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -404,6 +404,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);