1
0
Fork 0
mirror of https://github.com/alfg/mp4-rust.git synced 2024-06-02 13:39:54 +00:00

Skip over unknown boxes

If the box size is non-zero, skip over it and continue reading. Otherwise if
the box size is zero, exit the loop.
This commit is contained in:
Nathan Fiedler 2020-05-26 20:49:53 -07:00
parent f04ebb4b61
commit feb83e6452

View file

@ -83,7 +83,13 @@ fn read_boxes(f: File) -> Result<BMFF> {
BoxType::MoofBox => {
start = (size as u32 - HEADER_SIZE) as u64;
}
_ => break
_ => {
if size == 0 {
break;
} else {
start = (size as u32 - HEADER_SIZE) as u64;
}
}
};
}
Ok(bmff)