diff mbox

[FFmpeg-devel] avformat/mov: Set fragment.found_tfhd only after TFHD has been parsed

Message ID 20190615135154.14697-1-michael@niedermayer.cc
State Accepted
Commit 696312c487d9d8c49a087017a829d1cdcbd68651
Headers show

Commit Message

Michael Niedermayer June 15, 2019, 1:51 p.m. UTC
Fixes: Assertion failure
Fixes: crbug971646.mp4

Reported-by: Matt Wolenetz <wolenetz@google.com>
Reviewed-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/mov.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Michael Niedermayer June 25, 2019, 10:07 a.m. UTC | #1
On Sat, Jun 15, 2019 at 03:51:54PM +0200, Michael Niedermayer wrote:
> Fixes: Assertion failure
> Fixes: crbug971646.mp4
> 
> Reported-by: Matt Wolenetz <wolenetz@google.com>
> Reviewed-by: Matt Wolenetz <wolenetz@google.com>
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/mov.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

will apply

[...]
diff mbox

Patch

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 78f692872b..327a25bbdf 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4562,8 +4562,6 @@  static int mov_read_tfhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     MOVTrackExt *trex = NULL;
     int flags, track_id, i;
 
-    c->fragment.found_tfhd = 1;
-
     avio_r8(pb); /* version */
     flags = avio_rb24(pb);
 
@@ -4579,6 +4577,7 @@  static int mov_read_tfhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
         av_log(c->fc, AV_LOG_WARNING, "could not find corresponding trex (id %u)\n", track_id);
         return 0;
     }
+    c->fragment.found_tfhd = 1;
     frag->track_id = track_id;
     set_frag_stream(&c->frag_index, track_id);