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

This commit is contained in:
PeterN 2023-04-10 16:00:34 +01:00 committed by GitHub
parent e2f1cd44dc
commit 246ba6f00a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -5781,7 +5781,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]);