OSDN Git Service

Coverity #459: Silly off-by-one error.
authorAdam Jackson <ajax@freedesktop.org>
Mon, 3 Apr 2006 00:18:03 +0000 (00:18 +0000)
committerAdam Jackson <ajax@freedesktop.org>
Mon, 3 Apr 2006 00:18:03 +0000 (00:18 +0000)
src/mesa/drivers/dri/common/glcontextmodes.c

index d129799..f9e6715 100644 (file)
@@ -104,7 +104,7 @@ _gl_convert_to_x_visual_type( int visualType )
        GrayScale,   StaticGray
     };
 
-    return ( (unsigned) (visualType - GLX_TRUE_COLOR) <= NUM_VISUAL_TYPES )
+    return ( (unsigned) (visualType - GLX_TRUE_COLOR) < NUM_VISUAL_TYPES )
        ? x_visual_types[ visualType - GLX_TRUE_COLOR ] : -1;
 }