From b927a75979f9bbabca6e3b2601f222d29d70df49 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 3 Apr 2006 00:18:03 +0000 Subject: Coverity #459: Silly off-by-one error. --- src/mesa/drivers/dri/common/glcontextmodes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/common/glcontextmodes.c b/src/mesa/drivers/dri/common/glcontextmodes.c index d129799149..f9e6715fcd 100644 --- a/src/mesa/drivers/dri/common/glcontextmodes.c +++ b/src/mesa/drivers/dri/common/glcontextmodes.c @@ -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; } -- cgit v1.2.3