avformat/aacdec: resync to the next adts frame on invalid data instead of aborting
authorJames Almer <jamrial@gmail.com>
Sun, 21 Jul 2019 00:47:55 +0000 (21:47 -0300)
committerJames Almer <jamrial@gmail.com>
Sun, 21 Jul 2019 04:06:29 +0000 (01:06 -0300)
Should fix ticket #6634

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 881e1f5a6227a6fbaf67083d4d4b6caf58ff9892)

libavformat/aacdec.c

index 66fa49a..09fbab2 100644 (file)
@@ -190,9 +190,9 @@ retry:
         }
         if (!ff_id3v2_match(pkt->data, ID3v2_DEFAULT_MAGIC)) {
             av_packet_unref(pkt);
-            return AVERROR_INVALIDDATA;
-        }
-        ret = handle_id3(s, pkt);
+            ret = adts_aac_resync(s);
+        } else
+            ret = handle_id3(s, pkt);
         if (ret < 0)
             return ret;