Skip to content

Commit

Permalink
Fix #5377: Saved game keeps crashing shortly after loading
Browse files Browse the repository at this point in the history
Guard against null pointers in banner_paint() (#5379)
  • Loading branch information
rwjuk authored and IntelOrca committed Apr 17, 2017
1 parent 34540b6 commit 8f59b04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions contributors.md
Expand Up @@ -76,6 +76,7 @@ Includes all git commit authors. Aliases are GitHub user names.
* Jonathan Haas (HaasJona)
* Jake Breen (Haekb)
* Marco Benzi Tobar (Lisergishnu)
* Richard Jenkins (rwjuk)

## Toolchain
* (Balletie) - macOS
Expand Down
4 changes: 4 additions & 0 deletions src/openrct2/paint/map_element/banner.c
Expand Up @@ -48,6 +48,10 @@ void banner_paint(uint8 direction, sint32 height, rct_map_element* map_element)

rct_scenery_entry* banner_scenery = get_banner_entry(gBanners[map_element->properties.banner.index].type);

if ((banner_scenery == (rct_scenery_entry *)-1) || (banner_scenery == NULL)) {
return;
}

direction += map_element->properties.banner.position;
direction &= 3;

Expand Down

0 comments on commit 8f59b04

Please sign in to comment.