forked from Mirrors/openclonk
Fix buffer overflow in SetGamma when using an undefined gamma ramp
parent
7621c97b92
commit
2f505e2bc2
|
@ -828,6 +828,7 @@ void C4GraphicsSystem::SetGamma(DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, int32_
|
|||
{
|
||||
// No gamma effects
|
||||
if (Config.Graphics.DisableGamma) return;
|
||||
if (iRampIndex < 0 || iRampIndex >= C4MaxGammaRamps) return;
|
||||
// turn ramp index into array offset
|
||||
iRampIndex*=3;
|
||||
// set array members
|
||||
|
|
Loading…
Reference in New Issue