diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-06-15 00:12:36 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-07-01 12:11:55 +0200 |
commit | 857ecd6f2ef9d745a6a0efa4614cd69db1b11786 (patch) | |
tree | c6beaf9d4e22aafb07121aef5e475f0307d781ae /libavformat | |
parent | 93f48a978bc47e271465cc334cd6ec9ed22aa6f8 (diff) | |
download | ffmpeg-857ecd6f2ef9d745a6a0efa4614cd69db1b11786.tar.gz |
avformat/mov: Set fragment.found_tfhd only after TFHD has been parsed
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>
(cherry picked from commit 696312c487d9d8c49a087017a829d1cdcbd68651)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mov.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index df9640fa6d..624f09d3c9 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -4001,8 +4001,6 @@ static int mov_read_tfhd(MOVContext *c, AVIOContext *pb, MOVAtom atom) MOVFragmentIndex* index = NULL; int flags, track_id, i, found = 0; - c->fragment.found_tfhd = 1; - avio_r8(pb); /* version */ flags = avio_rb24(pb); @@ -4019,6 +4017,7 @@ static int mov_read_tfhd(MOVContext *c, AVIOContext *pb, MOVAtom atom) av_log(c->fc, AV_LOG_ERROR, "could not find corresponding trex\n"); return AVERROR_INVALIDDATA; } + c->fragment.found_tfhd = 1; frag->base_data_offset = flags & MOV_TFHD_BASE_DATA_OFFSET ? avio_rb64(pb) : flags & MOV_TFHD_DEFAULT_BASE_IS_MOOF ? |