(svn r8166) -Fix (r7797): Protect against out of bounds access to the sprite ptr
list.
--- a/src/spritecache.cpp Tue Jan 16 21:34:51 2007 +0000
+++ b/src/spritecache.cpp Tue Jan 16 22:10:35 2007 +0000
@@ -107,7 +107,7 @@
{
/* Special case for Sprite ID zero -- its position is also 0... */
if (id == 0) return true;
-
+ if (id >= _spritecache_items) return false;
return GetSpriteCache(id)->file_pos != 0;
}
@@ -386,7 +386,7 @@
SpriteCache *sc;
void* p;
- assert(sprite < MAX_SPRITES);
+ assert(sprite < _spritecache_items);
sc = GetSpriteCache(sprite);