diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 3cd8a5cbf8..09bccccac2 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -24,6 +24,7 @@ - Fix: [#9957] When using 'no money' cheat, guests complain of running out of cash. - Fix: [#9970] Wait for quarter load fails. - Fix: [#10017] Ghost elements influencing ride excitement. +- Fix: [#10036] Do not allocate large chunks of memory for save file classification. - Improved: [#9466] Add the rain weather effect to the OpenGL renderer. - Improved: [#9987] Minimum load rounding. diff --git a/src/openrct2/rct12/SawyerChunkReader.cpp b/src/openrct2/rct12/SawyerChunkReader.cpp index e1101fd9d0..5764a0f917 100644 --- a/src/openrct2/rct12/SawyerChunkReader.cpp +++ b/src/openrct2/rct12/SawyerChunkReader.cpp @@ -68,6 +68,9 @@ std::shared_ptr SawyerChunkReader::ReadChunk() try { auto header = _stream->ReadValue(); + if (header.length >= MAX_UNCOMPRESSED_CHUNK_SIZE) + throw SawyerChunkException(EXCEPTION_MSG_CORRUPT_CHUNK_SIZE); + switch (header.encoding) { case CHUNK_ENCODING_NONE: