mirror of
				https://github.com/Ryujinx/Opentk.git
				synced 2025-11-04 12:44:57 +00:00 
			
		
		
		
	[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:
		
							parent
							
								
									2b6aec3b23
								
							
						
					
					
						commit
						ff36f0f35a
					
				| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue