mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 712277 - Avoid crash in zlib adler32 following compression failure; r=michal.novotny
This commit is contained in:
parent
f3228da812
commit
1272d727f0
4
netwerk/cache/nsCacheEntryDescriptor.cpp
vendored
4
netwerk/cache/nsCacheEntryDescriptor.cpp
vendored
@ -915,6 +915,8 @@ nsCompressOutputStreamWrapper::Write(const char * buf,
|
||||
while (mZstream.avail_in > 0) {
|
||||
zerr = deflate(&mZstream, Z_NO_FLUSH);
|
||||
if (zerr == Z_STREAM_ERROR) {
|
||||
deflateEnd(&mZstream);
|
||||
mStreamInitialized = PR_FALSE;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
// Note: Z_BUF_ERROR is non-fatal and sometimes expected here.
|
||||
@ -924,6 +926,8 @@ nsCompressOutputStreamWrapper::Write(const char * buf,
|
||||
if (mZstream.avail_out == 0) {
|
||||
rv = WriteBuffer();
|
||||
if (NS_FAILED(rv)) {
|
||||
deflateEnd(&mZstream);
|
||||
mStreamInitialized = PR_FALSE;
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user