import from UXP: Fix cache v1 compression crash in nsCompressOutputStreamWrapper::Close() (8c917ef3)

This commit is contained in:
2022-03-25 16:47:02 +08:00
parent c937ebf733
commit 40556cd638
+6
View File
@@ -1399,6 +1399,12 @@ nsCompressOutputStreamWrapper::Close()
// Do not allow to initialize stream after calling Close().
mStreamEnded = true;
// In some rare cases, flushing the zlib stream can take too long
// and we lose our cache entry in the meantime. Do another check
// and bail if so.
if (!mDescriptor)
return NS_ERROR_NOT_AVAILABLE;
if (mDescriptor->CacheEntry()) {
nsAutoCString uncompressedLenStr;
rv = mDescriptor->GetMetaDataElement("uncompressed-len",