aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-09-08 21:08:31 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-12-06 20:30:57 +0100
commit880579a763872f887d9da07b2c2dc336e3d5cb33 (patch)
tree90759c92a8c8729acbefd2574e000de8ab424de3 /libavcodec
parente15fd9bc25628a7148bb1426dc5c6993d10db701 (diff)
downloadffmpeg-880579a763872f887d9da07b2c2dc336e3d5cb33.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>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/aacdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 950cec05b4..b7b784d917 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -403,6 +403,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);