]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/mov.c
avfilter/af_astats: fix flt(p) support
[ffmpeg] / libavformat / mov.c
index 7c8f784d71942103f9ae2e5580e79e27aea26010..134953efd93ee5ce3e761a9030a28fb089584de3 100644 (file)
@@ -43,6 +43,7 @@
 #include "libavutil/sha.h"
 #include "libavutil/timecode.h"
 #include "libavcodec/ac3tab.h"
+#include "libavcodec/mpegaudiodecheader.h"
 #include "avformat.h"
 #include "internal.h"
 #include "avio_internal.h"
@@ -4829,8 +4830,9 @@ static int mov_read_close(AVFormatContext *s)
         av_freep(&sc->rap_group);
         av_freep(&sc->display_matrix);
 
-        for (j = 0; j < sc->stsd_count; j++)
-            av_free(sc->extradata[j]);
+        if (sc->extradata)
+            for (j = 0; j < sc->stsd_count; j++)
+                av_free(sc->extradata[j]);
         av_freep(&sc->extradata);
         av_freep(&sc->extradata_size);
 
@@ -5340,6 +5342,10 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
                 return ret;
         }
 #endif
+        if (st->codecpar->codec_id == AV_CODEC_ID_MP3 && !st->need_parsing && pkt->size > 4) {
+            if (ff_mpa_check_header(AV_RB32(pkt->data)) < 0)
+                st->need_parsing = AVSTREAM_PARSE_FULL;
+        }
     }
 
     pkt->stream_index = sc->ffindex;