projects
/
platform
/
core
/
csapi
/
opentk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2b6aec3
)
[OpenTK] Clamp max AA level to 64x
author
thefiddler
<stapostol@gmail.com>
Wed, 22 Jan 2014 09:35:08 +0000
(10:35 +0100)
committer
thefiddler
<stapostol@gmail.com>
Wed, 22 Jan 2014 09:35:08 +0000
(10:35 +0100)
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.
Source/OpenTK/Graphics/GraphicsMode.cs
patch
|
blob
|
history
diff --git
a/Source/OpenTK/Graphics/GraphicsMode.cs
b/Source/OpenTK/Graphics/GraphicsMode.cs
index
1068f83
..
aad7fae
100644
(file)
--- 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