mirror of
https://github.com/GTAmodding/re3.git
synced 2024-11-15 05:29:01 +00:00
fix UB
This commit is contained in:
parent
77884e0a57
commit
1a8a1c91cb
1 changed files with 5 additions and 0 deletions
|
@ -104,7 +104,12 @@ CExplosion::AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionT
|
|||
#endif
|
||||
|
||||
int n = 0;
|
||||
#ifdef FIX_BUGS
|
||||
while (n < ARRAY_SIZE(gaExplosion) && gaExplosion[n].m_nIteration != 0)
|
||||
#else
|
||||
// array overrun is UB
|
||||
while (gaExplosion[n].m_nIteration != 0 && n < ARRAY_SIZE(gaExplosion))
|
||||
#endif
|
||||
n++;
|
||||
if (n == ARRAY_SIZE(gaExplosion))
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue