Fix: Variable 0x85 had no bounds checks.

pull/73/head
frosch 6 years ago committed by Jonathan G Rennison
parent a36304481e
commit 97d6e3c90f

@ -5933,7 +5933,8 @@ static uint32 GetParamVal(byte param, uint32 *cond_val)
/* Supported in Action 0x07 and 0x09, not 0x0D */
return 0;
} else {
uint32 param_val = _ttdpatch_flags[*cond_val / 0x20];
uint32 index = *cond_val / 0x20;
uint32 param_val = index < lengthof(_ttdpatch_flags) ? _ttdpatch_flags[index] : 0;
*cond_val %= 0x20;
return param_val;
}

Loading…
Cancel
Save