Skip to content

Commit

Permalink
Ignore trailing date in the IDAT stream (#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
fintelia authored Jan 13, 2024
1 parent 9c97a56 commit f1e7fa0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/decoder/zlib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ impl ZlibStream {
data: &[u8],
image_data: &mut Vec<u8>,
) -> Result<usize, DecodingError> {
// There may be more data past the adler32 checksum at the end of the deflate stream. We
// match libpng's default behavior and ignore any trailing data. In the future we may want
// to add a flag to control this behavior.
if self.state.is_done() {
return Ok(data.len());
}

self.prepare_vec_for_appending();

if !self.started && self.ignore_adler32 {
Expand Down

0 comments on commit f1e7fa0

Please sign in to comment.