Validate access to _terrainEdgeSpriteIds (#4752)

This commit is contained in:
Michał Janiszewski 2017-06-06 09:25:04 +02:00 committed by Ted John
parent c95dbf4b2f
commit 3c7499f370
1 changed files with 2 additions and 0 deletions

View File

@ -502,6 +502,8 @@ static void viewport_surface_draw_land_side_top(enum edge_t edge, uint8 height,
return;
}
assert(terrain < countof(_terrainEdgeSpriteIds));
if (!(gCurrentViewportFlags & VIEWPORT_FLAG_UNDERGROUND_INSIDE)) {
uint8 incline = (regs.cl - regs.al) + 1;