(svn r22517) -Fix (r22472): If a NewGRF sprite ran out of bytes at a very specific point, data might be freed twice.

This commit is contained in:
frosch 2011-05-29 16:54:40 +00:00
parent a2dcfce59d
commit 2d24e00b27

View File

@ -1255,9 +1255,8 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte
}
case 0x09: // Define sprite layout
delete[] statspec->renderdata; // delete earlier loaded stuff
statspec->tiles = buf->ReadExtendedByte();
delete[] statspec->renderdata; // delete earlier loaded stuff
statspec->renderdata = new NewGRFSpriteLayout[statspec->tiles];
for (uint t = 0; t < statspec->tiles; t++) {