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);