From d009203c249a14d40280e79c28cd44e8c5abeaa9 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 3 Apr 2021 18:08:17 -0700 Subject: [PATCH] Deflt: Correct available input length. The length of the output buffer can't have been always correct. --- Core/HLE/sceDeflt.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/HLE/sceDeflt.cpp b/Core/HLE/sceDeflt.cpp index b2c29ea2f1..fdf7b0d55c 100644 --- a/Core/HLE/sceDeflt.cpp +++ b/Core/HLE/sceDeflt.cpp @@ -38,7 +38,8 @@ static int CommonDecompress(int windowBits, u32 OutBuffer, int OutBufferLength, z_stream stream{}; u8 *outBufferPtr = Memory::GetPointer(OutBuffer); stream.next_in = (Bytef*)Memory::GetPointer(InBuffer); - stream.avail_in = (uInt)OutBufferLength; + // We don't know the available length, just let it use as much as it wants. + stream.avail_in = (uInt)Memory::ValidSize(InBuffer, Memory::g_MemorySize); stream.next_out = outBufferPtr; stream.avail_out = (uInt)OutBufferLength;