[FFmpeg-cvslog] aac: Relax reserved_bit validation

Vittorio Giovara git at videolan.org
Wed Mar 4 20:03:32 CET 2015


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Tue Mar  3 19:38:32 2015 +0000| [87e85a133f3ce2f037b90e9c7bbca99951df6c15] | committer: 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: Vittorio Giovara <vittorio.giovara at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=87e85a133f3ce2f037b90e9c7bbca99951df6c15
---

 libavcodec/aacdec.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index c4234e7..7236a05 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -1143,7 +1143,8 @@ static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics,
     if (aot != AOT_ER_AAC_ELD) {
         if (get_bits1(gb)) {
             av_log(ac->avctx, AV_LOG_ERROR, "Reserved bit set.\n");
-            return AVERROR_INVALIDDATA;
+            if (ac->avctx->err_recognition & AV_EF_BITSTREAM)
+                return AVERROR_INVALIDDATA;
         }
         ics->window_sequence[1] = ics->window_sequence[0];
         ics->window_sequence[0] = get_bits(gb, 2);



More information about the ffmpeg-cvslog mailing list