mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
Improve checks for object files (#8417)
This commit is contained in:
committed by
GitHub
parent
9f048c42df
commit
23dc14b286
@@ -71,7 +71,7 @@ class ObjectFileIndex final : public FileIndex<ObjectRepositoryItem>
|
||||
{
|
||||
private:
|
||||
static constexpr uint32_t MAGIC_NUMBER = 0x5844494F; // OIDX
|
||||
static constexpr uint16_t VERSION = 18;
|
||||
static constexpr uint16_t VERSION = 19;
|
||||
static constexpr auto PATTERN = "*.dat;*.pob;*.json;*.parkobj";
|
||||
|
||||
IObjectRepository& _objectRepository;
|
||||
|
||||
@@ -195,6 +195,10 @@ size_t SawyerChunkReader::DecodeChunkRLE(void* dst, size_t dstCapacity, const vo
|
||||
{
|
||||
throw SawyerChunkException(EXCEPTION_MSG_DESTINATION_TOO_SMALL);
|
||||
}
|
||||
if (i + 1 + rleCodeByte + 1 > srcLength)
|
||||
{
|
||||
throw SawyerChunkException(EXCEPTION_MSG_CORRUPT_RLE);
|
||||
}
|
||||
|
||||
std::memcpy(dst8, src8 + i + 1, rleCodeByte + 1);
|
||||
dst8 += rleCodeByte + 1;
|
||||
|
||||
Reference in New Issue
Block a user