mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Calculate mp4 header length correctly.
This commit is contained in:
parent
a24e86e76f
commit
ec0ea465ec
2 changed files with 15 additions and 2 deletions
|
@ -325,8 +325,8 @@ impl Mp4Matcher {
|
|||
return false;
|
||||
}
|
||||
|
||||
let box_size = ((data[0] as u32) << 3 | (data[1] as u32) << 2 |
|
||||
(data[2] as u32) << 1 | (data[3] as u32)) as usize;
|
||||
let box_size = ((data[0] as u32) << 24 | (data[1] as u32) << 16 |
|
||||
(data[2] as u32) << 8 | (data[3] as u32)) as usize;
|
||||
if (data.len() < box_size) || (box_size % 4 != 0) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue