Commit cd9e2497 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/mov: Set fragment.found_tfhd only after TFHD has been parsed

Fixes: Assertion failure
Fixes: crbug971646.mp4
Reported-by: 's avatarMatt Wolenetz <wolenetz@google.com>
Reviewed-by: 's avatarMatt Wolenetz <wolenetz@google.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 696312c4)
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 4c9b4ce1
......@@ -4544,8 +4544,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);
......@@ -4563,6 +4561,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 ?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment