[FFmpeg-cvslog] avcodec/aac_adtstoasc: fix ASC passthrough on small frames

James Almer git at videolan.org
Tue May 16 17:55:16 EEST 2017


ffmpeg | branch: release/3.1 | James Almer <jamrial at gmail.com> | Tue Apr 11 01:03:51 2017 -0300| [75f9fe1519deba4285cbc8cb5b8919b97ba40366] | committer: James Almer

avcodec/aac_adtstoasc: fix ASC passthrough on small frames

ASC frames smaller than AAC_ADTS_HEADER_SIZE were being discarded.

Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: James Almer <jamrial at gmail.com>
(cherry picked from commit 0f05f2c7e67949ce77de3cf7013f7d4da1c3e046)

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

 libavcodec/aac_adtstoasc_bsf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/aac_adtstoasc_bsf.c b/libavcodec/aac_adtstoasc_bsf.c
index 48889fc48e..d47fa230ab 100644
--- a/libavcodec/aac_adtstoasc_bsf.c
+++ b/libavcodec/aac_adtstoasc_bsf.c
@@ -49,14 +49,14 @@ static int aac_adtstoasc_filter(AVBSFContext *bsfc, AVPacket *out)
     if (ret < 0)
         return ret;
 
+    if (bsfc->par_in->extradata && in->size >= 2 && (AV_RB16(in->data) >> 4) != 0xfff)
+        goto finish;
+
     if (in->size < AAC_ADTS_HEADER_SIZE)
         goto packet_too_small;
 
     init_get_bits(&gb, in->data, AAC_ADTS_HEADER_SIZE * 8);
 
-    if (bsfc->par_in->extradata && show_bits(&gb, 12) != 0xfff)
-        goto finish;
-
     if (avpriv_aac_parse_header(&gb, &hdr) < 0) {
         av_log(bsfc, AV_LOG_ERROR, "Error parsing ADTS frame header!\n");
         ret = AVERROR_INVALIDDATA;



More information about the ffmpeg-cvslog mailing list