1
0
Fork 0

Fix 8361cf5a73: Missing bounds check for house specs. (#10625)

pull/10629/head
PeterN 2023-04-10 16:00:34 +01:00 committed by Charles Pigott
parent 353a6d4bfe
commit 15a32faece
1 changed files with 1 additions and 1 deletions

View File

@ -5647,7 +5647,7 @@ static void TownHouseMapSpriteGroup(ByteReader *buf, uint8 idcount)
if (!IsValidGroupID(groupid, "TownHouseMapSpriteGroup")) return;
for (uint i = 0; i < idcount; i++) {
HouseSpec *hs = _cur.grffile->housespec[houses[i]];
HouseSpec *hs = houses[i] >= NUM_HOUSES_PER_GRF ? nullptr : _cur.grffile->housespec[houses[i]];
if (hs == nullptr) {
grfmsg(1, "TownHouseMapSpriteGroup: House %d undefined, skipping.", houses[i]);