followup to array acess breaches: waterobject and guiparticlegraphctrl need to check >=, not just >

This commit is contained in:
AzaezelX 2020-07-27 10:45:45 -05:00
parent 1f93e362cc
commit 6b2db37f8a
2 changed files with 24 additions and 24 deletions

View file

@ -1120,7 +1120,7 @@ bool WaterObject::initMaterial( S32 idx )
// We must return false for any case which it is NOT safe for the caller
// to use the indexed material.
if ( idx < 0 || idx > NumMatTypes )
if ( idx < 0 || idx >= NumMatTypes )
return false;
BaseMatInstance *mat = mMatInstances[idx];