Handle insufficient buffer size as expected error
This commit is contained in:
parent
4ec8cf8c7f
commit
d0f3a705cb
1 changed files with 1 additions and 1 deletions
|
|
@ -81,7 +81,7 @@ pub fn cfzlib_deflate(
|
||||||
stream.avail_out = out.capacity() as uInt;
|
stream.avail_out = out.capacity() as uInt;
|
||||||
match deflate(&mut stream, Z_FINISH) {
|
match deflate(&mut stream, Z_FINISH) {
|
||||||
Z_STREAM_END => {}
|
Z_STREAM_END => {}
|
||||||
Z_OK => {
|
Z_OK | Z_BUF_ERROR => {
|
||||||
deflateEnd(&mut stream);
|
deflateEnd(&mut stream);
|
||||||
return Err(PngError::DeflatedDataTooLong(stream.total_out as usize));
|
return Err(PngError::DeflatedDataTooLong(stream.total_out as usize));
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue