We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a3590df commit eae5336Copy full SHA for eae5336
src/png/scan_lines.rs
@@ -27,6 +27,8 @@ impl<'a> Iterator for ScanLines<'a> {
27
let (len, pass, num_pixels) = self.iter.next()?;
28
debug_assert!(self.raw_data.len() >= len);
29
debug_assert!(!self.has_filter || len > 1);
30
+ // The data length should always be correct here but this check assures
31
+ // the compiler that it doesn't need to account for a potential panic
32
if self.raw_data.len() < len {
33
return None;
34
}
0 commit comments