mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-02 17:26:35 +01:00
(svn r4481) - Fix: Validate the given sprite ID when loading a sprite.
This commit is contained in:
parent
ccdf322799
commit
3786527e6b
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user