Avoid printing output bytes on decompress error
Instead, print the number of bytes decompressed so far Fixes #452
This commit is contained in:
parent
9479f5f4f5
commit
86a72ea127
1 changed files with 7 additions and 2 deletions
|
|
@ -27,8 +27,13 @@ pub mod cfzlib {
|
||||||
|
|
||||||
/// Decompress a data stream using the DEFLATE algorithm
|
/// Decompress a data stream using the DEFLATE algorithm
|
||||||
pub fn inflate(data: &[u8]) -> PngResult<Vec<u8>> {
|
pub fn inflate(data: &[u8]) -> PngResult<Vec<u8>> {
|
||||||
miniz_oxide::inflate::decompress_to_vec_zlib(data)
|
miniz_oxide::inflate::decompress_to_vec_zlib(data).map_err(|e| {
|
||||||
.map_err(|e| PngError::new(&format!("Error on decompress: {:?}", e)))
|
PngError::new(&format!(
|
||||||
|
"Error on decompress: {:?} (after {:?} decompressed bytes)",
|
||||||
|
e.status,
|
||||||
|
e.output.len()
|
||||||
|
))
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Compress a data stream using the DEFLATE algorithm
|
/// Compress a data stream using the DEFLATE algorithm
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue