We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f7b9ed0 commit a78e441Copy full SHA for a78e441
mp4parse/src/lib.rs
@@ -1656,11 +1656,15 @@ fn read_pixi<T: Read>(src: &mut BMFFBox<T>) -> Result<TryVec<u8>> {
1656
return Err(Error::Unsupported("pixi version"));
1657
}
1658
1659
- let mut channels = TryVec::new();
1660
- let channel_count = src.read_u8()?;
1661
- for _ in 0..channel_count {
1662
- channels.push(src.read_u8()?)?;
+ let num_channels = src.read_u8()?.into();
+ let mut channels = TryVec::with_capacity(num_channels)?;
+ let num_channels_read = src.try_read_to_end(&mut channels)?;
+
1663
+ if num_channels_read != num_channels.into() {
1664
+ return Err(Error::InvalidData("invalid num_channels"));
1665
1666
1667
+ check_parser_state!(src.content);
1668
Ok(channels)
1669
1670
0 commit comments