From 5b449145f7983d44d73195b8a18e4a2da721ee71 Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 29 May 2011 16:54:40 +0000 Subject: (svn r22517) -Fix (r22472): If a NewGRF sprite ran out of bytes at a very specific point, data might be freed twice. --- src/newgrf.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 0b0fe63b4..605b17023 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -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++) { -- cgit v1.2.3-70-g09d2