mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 09:39:33 +01:00
PSAR: Accept zlib 1.4's error for streams without a checksum
zlib 1.4's uncompress2 returns Z_DATA_ERROR, not Z_BUF_ERROR, when the input runs out with the output full, so every file in the pre-decrypted 3.60 archive failed to inflate after the zlib update. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a0af2bc403
commit
004dcdfe93
1 file changed
+3
-2
@@ -739,8 +739,9 @@ void PSARReader::EnsureContents() {
|
||||
uLongf destLen = contentExpandedSize_;
|
||||
uLong sourceLen = decoded;
|
||||
int zResult = uncompress2(entryData_.data(), &destLen, block2_.data(), &sourceLen);
|
||||
// Handle zip streams missing their Adler-32 checksum.
|
||||
if (zResult == Z_BUF_ERROR && sourceLen == (uLong)decoded && destLen == contentExpandedSize_ && decrypted_) {
|
||||
// Handle zip streams missing their Adler-32 checksum (the pre-decrypted 3.60 archive's). The
|
||||
// input runs out with the output full, which zlib 1.4 reports as Z_DATA_ERROR, 1.3 as Z_BUF_ERROR.
|
||||
if ((zResult == Z_BUF_ERROR || zResult == Z_DATA_ERROR) && sourceLen == (uLong)decoded && destLen == contentExpandedSize_ && decrypted_) {
|
||||
zResult = Z_OK;
|
||||
}
|
||||
if (zResult != Z_OK || destLen != contentExpandedSize_) {
|
||||
|
||||
Reference in new issue
Block a user