Commit 1cd9a615 authored by Alex Converse's avatar Alex Converse

aac: fix infinite loop on end-of-frame with sequence of 1-bits.

Based-on-work-by: 's avatarRonald S. Bultje <rsbultje@gmail.com>
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
parent b142496c
......@@ -973,8 +973,8 @@ static int decode_band_types(AACContext *ac, enum BandType band_type[120],
av_log(ac->avctx, AV_LOG_ERROR, "invalid band type\n");
return -1;
}
while ((sect_len_incr = get_bits(gb, bits)) == (1 << bits) - 1)
sect_end += sect_len_incr;
do {
sect_len_incr = get_bits(gb, bits);
sect_end += sect_len_incr;
if (get_bits_left(gb) < 0) {
av_log(ac->avctx, AV_LOG_ERROR, overread_err);
......@@ -986,6 +986,7 @@ static int decode_band_types(AACContext *ac, enum BandType band_type[120],
sect_end, ics->max_sfb);
return -1;
}
} while (sect_len_incr == (1 << bits) - 1);
for (; k < sect_end; k++) {
band_type [idx] = sect_band_type;
band_type_run_end[idx++] = sect_end;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment