mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 11:10:47 +00:00
Prevent OOB array access when EVENT_INVENTORYLEFT or EVENT_INVENTORYRIGHT returns a bad value
git-svn-id: https://svn.eduke32.com/eduke32@7026 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
eeba7847eb
commit
2206581952
1 changed files with 3 additions and 3 deletions
|
@ -2627,10 +2627,10 @@ CHECKINV1:
|
||||||
|
|
||||||
if (inventoryIcon || pPlayer->inv_amount[GET_FIRSTAID])
|
if (inventoryIcon || pPlayer->inv_amount[GET_FIRSTAID])
|
||||||
{
|
{
|
||||||
static const int32_t i[8] = { QUOTE_MEDKIT, QUOTE_STEROIDS, QUOTE_HOLODUKE,
|
static const int32_t invQuotes[8] = { QUOTE_MEDKIT, QUOTE_STEROIDS, QUOTE_HOLODUKE,
|
||||||
QUOTE_JETPACK, QUOTE_NVG, QUOTE_SCUBA, QUOTE_BOOTS, 0 };
|
QUOTE_JETPACK, QUOTE_NVG, QUOTE_SCUBA, QUOTE_BOOTS, 0 };
|
||||||
if (inventoryIcon>=1 && inventoryIcon<=9)
|
if (inventoryIcon-1 < ARRAY_SSIZE(invQuotes))
|
||||||
P_DoQuote(i[inventoryIcon-1], pPlayer);
|
P_DoQuote(invQuotes[inventoryIcon-1], pPlayer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue