1
0
Fork 0

(svn r4481) - Fix: Validate the given sprite ID when loading a sprite.

release/0.5
peter1138 2006-04-20 05:57:47 +00:00
parent ccdf322799
commit 3786527e6b
1 changed files with 4 additions and 0 deletions

View File

@ -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;