OpenRCT2/src/openrct2/object
Michał Janiszewski 92c4c39b96 Guard from nullptr dereference in object_entry_get_entry
While looking at
https://github.com/OpenRCT2/OpenRCT2/issues/7176#issuecomment-365399194
I got a crash with stacktrace:

    #0 0x7f9e81fa2e30 in object_entry_get_entry(int, unsigned long) ../src/openrct2/object/ObjectList.cpp:181
    #1 0x7f9e81fa24ae in get_loaded_object_entry(unsigned long) ../src/openrct2/object/ObjectList.cpp:142
    #2 0x7f9e8215d64f in S6Exporter::Export() ../src/openrct2/rct2/S6Exporter.cpp:169
    #3 0x7f9e8216de71 in scenario_save(char const*, int) ../src/openrct2/rct2/S6Exporter.cpp:757
    #4 0x7f9e81c932b0 in game_autosave() ../src/openrct2/Game.cpp:1590
    #5 0x7f9e828625b6 in scenario_autosave_check() ../src/openrct2/scenario/Scenario.cpp:297
    #6 0x7f9e81c8a958 in game_update() ../src/openrct2/Game.cpp:439
    #7 0x7f9e81c6731f in OpenRCT2::Context::Update() (/home/janisozaur/workspace/OpenRCT2/build/libopenrct2.so+0x10f331f)
    #8 0x7f9e81c6674c in OpenRCT2::Context::RunVariableFrame() (/home/janisozaur/workspace/OpenRCT2/build/libopenrct2.so+0x10f274c)
    #9 0x7f9e81c6402d in OpenRCT2::Context::RunFrame() (/home/janisozaur/workspace/OpenRCT2/build/libopenrct2.so+0x10f002d)
    #10 0x7f9e81c638f4 in OpenRCT2::Context::RunGameLoop() (/home/janisozaur/workspace/OpenRCT2/build/libopenrct2.so+0x10ef8f4)
    #11 0x7f9e81c627bf in OpenRCT2::Context::Launch() (/home/janisozaur/workspace/OpenRCT2/build/libopenrct2.so+0x10ee7bf)
    #12 0x7f9e81c5b08a in OpenRCT2::Context::RunOpenRCT2(int, char const**) ../src/openrct2/Context.cpp:170
    #13 0x56323695b95e in main ../src/openrct2-ui/Ui.cpp:60

Sadly I cannot reproduce it anymore
2018-02-14 09:48:34 +01:00
..
BannerObject.cpp Add more object source filters 2018-01-31 13:07:20 +01:00
BannerObject.h Remove __cplusplus ifdefs 2018-02-05 16:20:15 +01:00
DefaultObjects.cpp Move most of _legacy.c to C++ (#7117) 2018-02-02 23:11:41 +01:00
DefaultObjects.h Move most of _legacy.c to C++ (#7117) 2018-02-02 23:11:41 +01:00
EntranceObject.cpp Compile localisation folder as C++ 2018-01-06 18:32:25 +01:00
EntranceObject.h Remove __cplusplus ifdefs 2018-02-05 16:20:15 +01:00
FootpathItemObject.cpp Fix #7111: Path items appear twice in build menu 2018-02-01 11:39:34 +01:00
FootpathItemObject.h Remove __cplusplus ifdefs 2018-02-05 16:20:15 +01:00
FootpathObject.cpp Compile files in world folder as C++ 2018-01-11 13:25:09 +01:00
FootpathObject.h Remove __cplusplus ifdefs 2018-02-05 16:20:15 +01:00
ImageTable.cpp Replace Memory::Set with std::fill or similar 2018-02-04 12:35:02 +00:00
ImageTable.h Remove __cplusplus ifdefs 2018-02-05 16:20:15 +01:00
LargeSceneryObject.cpp Remove Memory::Duplicate and Memory::DuplicateArray (#7142) 2018-02-07 19:56:46 +00:00
LargeSceneryObject.h Remove Memory::Duplicate and Memory::DuplicateArray (#7142) 2018-02-07 19:56:46 +00:00
Object.cpp Temporarily fix #7173: cannot load saves into vanilla 2018-02-14 09:26:59 +01:00
Object.h Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
ObjectFactory.cpp Use object_entry_get_type() throughout 2018-02-13 16:42:18 +01:00
ObjectFactory.h Remove __cplusplus ifdefs 2018-02-05 16:20:15 +01:00
ObjectLimits.h Refactor objects 2018-01-03 10:16:51 +01:00
ObjectList.cpp Guard from nullptr dereference in object_entry_get_entry 2018-02-14 09:48:34 +01:00
ObjectList.h Remove legacy object list 2018-02-12 12:48:41 +00:00
ObjectManager.cpp Use std::vector for ObjectManager 2018-02-12 17:15:15 +00:00
ObjectManager.h Get entries directly from object manager 2018-02-12 12:48:41 +00:00
ObjectRepository.cpp Use object_entry_get_type() throughout 2018-02-13 16:42:18 +01:00
ObjectRepository.h Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
RideObject.cpp Name animation flags 2018-01-30 12:53:50 +00:00
RideObject.h Remove __cplusplus ifdefs 2018-02-05 16:20:15 +01:00
SceneryGroupObject.cpp Remove Memory::Duplicate and Memory::DuplicateArray (#7142) 2018-02-07 19:56:46 +00:00
SceneryGroupObject.h Remove Memory::Duplicate and Memory::DuplicateArray (#7142) 2018-02-07 19:56:46 +00:00
SceneryObject.h Remove __cplusplus ifdefs 2018-02-05 16:20:15 +01:00
SmallSceneryObject.cpp Remove Memory::Duplicate and Memory::DuplicateArray (#7142) 2018-02-07 19:56:46 +00:00
SmallSceneryObject.h Remove Memory::Duplicate and Memory::DuplicateArray (#7142) 2018-02-07 19:56:46 +00:00
StexObject.cpp Compile localisation folder as C++ 2018-01-06 18:32:25 +01:00
StexObject.h Remove __cplusplus ifdefs 2018-02-05 16:20:15 +01:00
StringTable.cpp Use const and constexpr whenever possible. 2018-01-11 22:29:08 +01:00
StringTable.h Remove __cplusplus ifdefs 2018-02-05 16:20:15 +01:00
WallObject.cpp Compile localisation folder as C++ 2018-01-06 18:32:25 +01:00
WallObject.h Remove __cplusplus ifdefs 2018-02-05 16:20:15 +01:00
WaterObject.cpp Compile localisation folder as C++ 2018-01-06 18:32:25 +01:00
WaterObject.h Remove __cplusplus ifdefs 2018-02-05 16:20:15 +01:00