(svn r7242) -Fix: Don't load 1-byte pseudo sprites, as used in some NewGRF sets. If the sprite is ever drawn this will result in a "missing sprite" error instead of undefined misbehaviour leading to segmentation faults...

This commit is contained in:
peter1138 2006-11-23 21:19:43 +00:00
parent 59723b113e
commit 1ce4eda576
1 changed files with 3 additions and 1 deletions

View File

@ -45,7 +45,9 @@ static bool ReadSpriteHeaderSkipData(void)
type = FioReadByte();
if (type == 0xFF) {
FioSkipBytes(num);
return true;
/* Some NewGRF files have "empty" pseudo-sprites which are 1
* byte long. Catch these so the sprites won't be displayed. */
return num != 1;
}
FioSkipBytes(7);