[OpenTK] Clamp max AA level to 64x

This protects against a potential denial-of-service issue during mode
selection, where the platform backend will try to reduce AA level until
a supported mode is found.
This commit is contained in:
thefiddler 2014-01-22 10:35:08 +01:00
parent 2b6aec3b23
commit ff36f0f35a

View file

@ -254,7 +254,14 @@ namespace OpenTK.Graphics
{ {
return samples; return samples;
} }
private set { samples = value; } private set
{
// Clamp antialiasing samples to max 64x
// This protects against a potential DOS during
// mode selection, when the user requests an
// abnormally high AA level.
samples = MathHelper.Clamp(value, 0, 64);
}
} }
#endregion #endregion