Skip to content

Commit

Permalink
Convert assert in read_box_header to an error return.
Browse files Browse the repository at this point in the history
  • Loading branch information
kinetiknz committed Oct 28, 2015
1 parent 65c741b commit a60ea2d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,9 @@ pub fn read_box_header<T: ReadBytesExt>(src: &mut T) -> Result<BoxHeader> {
0 => return Err(Error::InvalidData),
1 => {
let size64 = try!(be_u64(src));
assert!(size64 >= 16);
if size64 < 16 {
return Err(Error::InvalidData);
}
size64
},
2 ... 7 => return Err(Error::InvalidData),
Expand Down

0 comments on commit a60ea2d

Please sign in to comment.