mirror of https://github.com/OpenTTD/OpenTTD
(svn r4481) - Fix: Validate the given sprite ID when loading a sprite.
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