Commit 87e85a13 authored by Vittorio Giovara's avatar Vittorio Giovara

aac: Relax reserved_bit validation

Although the specification mandates this bit to zero, it may happen
that software tools incorrectly flip it to one, invalidating a possibly
valid stream.

Relax this restriction, by failing only when AV_EF_BITSTREAM is set.
This behaviour is similar to aac decoders in Firefox and Quicktime.
Signed-off-by: 's avatarVittorio Giovara <vittorio.giovara@gmail.com>
parent 25f613f8
...@@ -1143,6 +1143,7 @@ static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics, ...@@ -1143,6 +1143,7 @@ static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics,
if (aot != AOT_ER_AAC_ELD) { if (aot != AOT_ER_AAC_ELD) {
if (get_bits1(gb)) { if (get_bits1(gb)) {
av_log(ac->avctx, AV_LOG_ERROR, "Reserved bit set.\n"); av_log(ac->avctx, AV_LOG_ERROR, "Reserved bit set.\n");
if (ac->avctx->err_recognition & AV_EF_BITSTREAM)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
ics->window_sequence[1] = ics->window_sequence[0]; ics->window_sequence[1] = ics->window_sequence[0];
......
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