OpenRCT2/src/openrct2
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
..
actions Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
audio Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
cmdline Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
config Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
core Do not show file index error if it doesn't exist 2018-02-11 10:39:15 +00:00
drawing Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
interface Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
localisation Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
management Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
network Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
object Guard from nullptr dereference in object_entry_get_entry 2018-02-14 09:48:34 +01:00
paint Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
peep Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
platform Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
rct1 Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
rct2 Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
rct12 Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
ride Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
scenario Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
title Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
ui Remove __cplusplus ifdefs 2018-02-05 16:20:15 +01:00
util Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
windows Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
world Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
CMakeLists.txt Fix cmake build for openrct2-cli on macOS. 2018-02-12 23:15:41 +01:00
Cheats.cpp Reduce duplicate code 2018-02-13 00:11:29 +01:00
Cheats.h Remove almost every extern C block 2018-02-05 16:20:15 +01:00
CmdlineSprite.cpp Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
CmdlineSprite.h Remove almost every extern C block 2018-02-05 16:20:15 +01:00
Context.cpp Upgrade some char arrays to strings 2018-02-07 23:14:29 +01:00
Context.h Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
Date.cpp Add cheat and console command to set game date. 2018-01-07 23:53:47 +01:00
Date.h Add Date class 2017-11-10 19:32:32 +01:00
Diagnostic.cpp Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
Diagnostic.h Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
Editor.cpp Simplify selected object flags 2018-02-12 12:48:41 +00:00
Editor.h Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
EditorObjectSelectionSession.cpp Use object_entry_get_type() throughout 2018-02-13 16:42:18 +01:00
EditorObjectSelectionSession.h Simplify selected object flags 2018-02-12 12:48:41 +00:00
FileClassifier.cpp Fix mismatched deallocator in FileClassifier.cpp 2018-02-10 19:59:49 +01:00
FileClassifier.h Remove almost every extern C block 2018-02-05 16:20:15 +01:00
Game.cpp Remove most usages of object_entry_groups 2018-02-12 12:48:41 +00:00
Game.h Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
Imaging.cpp Remove almost every extern C block 2018-02-05 16:20:15 +01:00
Imaging.h Remove almost every extern C block 2018-02-05 16:20:15 +01:00
Input.cpp Move majority of input.c to UI 2017-12-16 15:47:38 +02:00
Input.h Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
Intro.cpp Refactor drawing.c to C++ 2018-01-05 22:57:57 +01:00
Intro.h Remove almost every extern C block 2018-02-05 16:20:15 +01:00
OpenRCT2.cpp Remove almost every extern C block 2018-02-05 16:20:15 +01:00
OpenRCT2.h Remove almost every extern C block 2018-02-05 16:20:15 +01:00
ParkImporter.cpp Remove almost every extern C block 2018-02-05 16:20:15 +01:00
ParkImporter.h Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
PlatformEnvironment.cpp Refactor memory handling in OpenGLShaderProgram.cpp 2018-01-21 11:17:41 +00:00
PlatformEnvironment.h Fix changelog 2018-01-21 11:17:41 +00:00
Version.cpp Remove almost every extern C block 2018-02-05 16:20:15 +01:00
Version.h Remove almost every extern C block 2018-02-05 16:20:15 +01:00
common.h Remove and replace C typedefs 2018-02-14 09:42:26 +01:00
libopenrct2.vcxproj Implement basic discord status report 2017-11-11 23:48:04 +00:00
readme.md Move contents of src into project sub directory 2017-01-04 17:44:12 +00:00
sprites.h Add preview images for RCT1 edge styles 2018-01-22 11:44:38 +01:00

readme.md

Source directory structure

  • audio

    Contains files for mixing and playing music and sound.

  • drawing

    Low level drawing logic and palette tables.

  • interface

    Window and widget logic, includes high level drawing and input.

  • localisation

    String IDs, currency and date logic.

  • network

    Network and multiplayer logic, includes management of network games and downloading / uploading of content.

  • management

    Park management logic such as finance, marketing and research.

  • peep

    Guest and staff definitions and logic such as action management and pathfinding.

  • platform

    Compiler and operating system specific code such as type definitions, message handling and file input / output.

  • ride

    Data and logic for rides, vehicles and track.

  • util

    Utility and helper functions.

  • windows

    Definitions and logic for all the windows in the game.

  • world

    World objects and mechanics such as the climate, landscape, sprites and park.