COMMON: Fix build when zlib not present

This commit is contained in:
Miro Kropacek 2022-12-27 16:42:09 +01:00 committed by Eugene Sandulenko
parent 0dd79669a3
commit a359ee1316

View file

@ -185,10 +185,14 @@ Common::SeekableReadStream *MacVISEArchive::ArchiveMember::createReadStream() co
//
// If this turns out to be significant, then this will need to be updated to pass information to the deflate decompressor to
// handle the non-standard behavior.
#if defined(USE_ZLIB)
if (!Common::inflateZlibHeaderless(decompressedData, uncompressedSize, &compressedData[0], compressedSize)) {
free(decompressedData);
return nullptr;
}
#else
return nullptr;
#endif
return new Common::MemoryReadStream(decompressedData, uncompressedSize, DisposeAfterUse::YES);
}