Got_Cheat/CHEAT_GIVEPOWERUP: avoid reading out of bounds

This commit is contained in:
James R 2024-01-27 01:11:48 -08:00
parent b323c6bdb7
commit 4576956ca6

View file

@ -6069,6 +6069,8 @@ static void Got_Cheat(UINT8 **cp, INT32 playernum)
UINT8 powerup = READUINT8(*cp);
UINT16 time = READUINT16(*cp);
powerup = min(powerup, LASTPOWERUP);
// FIXME: we should have actual KITEM_ name array
const char *powerupname = cv_kartdebugitem.PossibleValue[
1 + NUMKARTITEMS + (powerup - FIRSTPOWERUP)].strvalue;