mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1235427: [mp4] Properly parse tfhd box. r=jya
This commit is contained in:
parent
b32a205f1f
commit
91ff19af88
@ -693,9 +693,10 @@ Tfhd::Tfhd(Box& aBox, Trex& aTrex)
|
||||
mFlags = reader->ReadU32();
|
||||
size_t need = sizeof(uint32_t) /* trackid */;
|
||||
uint8_t flag[] = { 1, 2, 8, 0x10, 0x20, 0 };
|
||||
uint8_t flagSize[] = { sizeof(uint64_t), sizeof(uint32_t), sizeof(uint32_t), sizeof(uint32_t), sizeof(uint32_t) };
|
||||
for (size_t i = 0; flag[i]; i++) {
|
||||
if (mFlags & flag[i]) {
|
||||
need += sizeof(uint32_t);
|
||||
need += flagSize[i];
|
||||
}
|
||||
}
|
||||
if (reader->Remaining() < need) {
|
||||
@ -703,9 +704,9 @@ Tfhd::Tfhd(Box& aBox, Trex& aTrex)
|
||||
(uint64_t)reader->Remaining(), (uint64_t)need);
|
||||
return;
|
||||
}
|
||||
mBaseDataOffset =
|
||||
mFlags & 1 ? reader->ReadU32() : aBox.Parent()->Parent()->Offset();
|
||||
mTrackId = reader->ReadU32();
|
||||
mBaseDataOffset =
|
||||
mFlags & 1 ? reader->ReadU64() : aBox.Parent()->Parent()->Offset();
|
||||
if (mFlags & 2) {
|
||||
mDefaultSampleDescriptionIndex = reader->ReadU32();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user