forked from rosebudai/OpenRCT2-Web
protect objects against invalid allocation ids
This commit is contained in:
1 parent
80381cfaa0
commit
52928e1e08
26 files changed
+78
-54
No files matched your search
@@ -31,9 +31,7 @@ enum OBJ_STRING_ID
|
||||
|
||||
void WallObject::ReadLegacy(IReadObjectContext * context, IStream * stream)
|
||||
{
|
||||
_legacyType.name = stream->ReadValue<rct_string_id>();
|
||||
_legacyType.image = stream->ReadValue<uint32>();
|
||||
|
||||
stream->Seek(6, STREAM_SEEK_CURRENT);
|
||||
_legacyType.wall.tool_id = stream->ReadValue<uint8>();
|
||||
_legacyType.wall.flags = stream->ReadValue<uint8>();
|
||||
_legacyType.wall.height = stream->ReadValue<uint8>();
|
||||
@@ -75,6 +73,9 @@ void WallObject::Unload()
|
||||
{
|
||||
language_free_object_string(_legacyType.name);
|
||||
gfx_object_free_images(_legacyType.image, GetImageTable()->GetCount());
|
||||
|
||||
_legacyType.name = 0;
|
||||
_legacyType.image = 0;
|
||||
}
|
||||
|
||||
void WallObject::DrawPreview(rct_drawpixelinfo * dpi) const
|
||||
|
||||
Reference in new issue
Block a user