forked from mirror/OpenTTD
(svn r4481) - Fix: Validate the given sprite ID when loading a sprite.
This commit is contained in:
@@ -149,6 +149,10 @@ bool LoadNextSprite(int load_index, byte file_index)
|
||||
|
||||
if (!ReadSpriteHeaderSkipData()) return false;
|
||||
|
||||
if (load_index >= MAX_SPRITES) {
|
||||
error("Tried to load too many sprites (#%d; max %d)", load_index, MAX_SPRITES);
|
||||
}
|
||||
|
||||
_sprite_file_pos[load_index] = file_pos;
|
||||
|
||||
_sprite_ptr[load_index] = NULL;
|
||||
|
Reference in New Issue
Block a user