ffmpeg | branch: master | Dale Curtis <dalecur...@chromium.org> | Mon Feb 24 
16:52:10 2025 -0800| [696ea1c2236842572df88d573e24a39be3f19c98] | committer: 
Lynne

Don't attempt to parse ADTS from USAC packets.

It's not possible to put USAC into ADTS due to exceeding the
field size (4 bits) for ADTS profile. As such cases where
the frame starts with 0xfff shouldn't be checked.

This ensures the sample at https://crbug.com/396190942 is
properly detected as USAC content.

Signed-off-by: Dale Curtis <dalecur...@chromium.org>

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

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

diff --git a/libavcodec/aac/aacdec.c b/libavcodec/aac/aacdec.c
index 8d50ad6d09..22c70da27f 100644
--- a/libavcodec/aac/aacdec.c
+++ b/libavcodec/aac/aacdec.c
@@ -2391,7 +2391,8 @@ static int aac_decode_frame_int(AVCodecContext *avctx, 
AVFrame *frame,
     ac->frame = frame;
     *got_frame_ptr = 0;
 
-    if (show_bits(gb, 12) == 0xfff) {
+    // USAC can't be packed into ADTS due to field size limitations.
+    if (show_bits(gb, 12) == 0xfff && ac->oc[1].m4ac.object_type != AOT_USAC) {
         if ((err = parse_adts_frame_header(ac, gb)) < 0) {
             av_log(avctx, AV_LOG_ERROR, "Error decoding AAC frame header.\n");
             goto fail;

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to