diff --git a/Source/OpenTK/Graphics/GraphicsMode.cs b/Source/OpenTK/Graphics/GraphicsMode.cs index 1068f833..aad7fae2 100644 --- a/Source/OpenTK/Graphics/GraphicsMode.cs +++ b/Source/OpenTK/Graphics/GraphicsMode.cs @@ -254,7 +254,14 @@ namespace OpenTK.Graphics { 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