Skip to content

Commit

Permalink
Codefix: [NewGRF] Don't read an extended byte into uint8_t. (OpenTTD#…
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterN authored Jan 11, 2025
1 parent 8b664a4 commit 11529d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/newgrf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5051,8 +5051,8 @@ static void ReserveChangeInfo(ByteReader &buf)
if (feature != GSF_CARGOES && feature != GSF_GLOBALVAR && feature != GSF_RAILTYPES && feature != GSF_ROADTYPES && feature != GSF_TRAMTYPES) return;

uint8_t numprops = buf.ReadByte();
uint8_t numinfo = buf.ReadByte();
uint8_t index = buf.ReadExtendedByte();
uint8_t numinfo = buf.ReadByte();
uint16_t index = buf.ReadExtendedByte();

while (numprops-- && buf.HasData()) {
uint8_t prop = buf.ReadByte();
Expand Down

0 comments on commit 11529d8

Please sign in to comment.