Skip to content

Commit

Permalink
Fix libpng diagnostics for unexpctedeof
Browse files Browse the repository at this point in the history
  • Loading branch information
lilith committed Sep 5, 2024
1 parent 0a25255 commit be28a9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions imageflow_core/src/codecs/libpng_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ impl PngDec{
let len = decoder.io.try_get_length();
let pos = decoder.io.try_get_position();
let remaining = if len.is_some() && pos.is_some() {
Some(len.unwrap() - pos.unwrap())
Some(len.unwrap() as i64 - pos.unwrap() as i64)
} else {
None
};
let missing = remaining.map(|r| (bytes_requested as u64) - r);
let missing = remaining.map(|r| (bytes_requested as i64) - (r as i64));
let err =
FlowError::without_location(ErrorKind::DecodingIoError,
format!("{:?} (failed to read requested {} bytes (only {:?} remain), pos={:?}, len={:?}, missing={:?})", err, bytes_requested, remaining, pos, len, missing)).at(here!());
Expand Down

0 comments on commit be28a9d

Please sign in to comment.