diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index 98b6e58be3..d17852d8ba 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -409,6 +409,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);