Deflt: Correct available input length.

The length of the output buffer can't have been always correct.
This commit is contained in:
Unknown W. Brackets 2021-04-03 18:08:17 -07:00
parent ba71d9b555
commit d009203c24

View File

@ -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;