From ee6f3d4d9bc8e713e112dea9e8fec04fa269d065 Mon Sep 17 00:00:00 2001 From: Antonio Hobmeir Neto Date: Thu, 21 Sep 2006 14:06:25 -0300 Subject: [PATCH] Fix index matching of visuals The function find_mesa_visual return a wrong element of visual vector. The index of vector is shift one element. Then I basically decremented one of index. --- GL/mesa/X/xf86glx.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/GL/mesa/X/xf86glx.c b/GL/mesa/X/xf86glx.c index 94959d6..735ade0 100644 --- a/GL/mesa/X/xf86glx.c +++ b/GL/mesa/X/xf86glx.c @@ -306,8 +306,10 @@ find_mesa_visual(__GLXscreen *screen, Vi i++; } + + i--; - return (modes != NULL) ? mesaScreen->xm_vis[i] : NULL; + return (modes != NULL && i >=0 ) ? mesaScreen->xm_vis[i] : NULL; } static void init_screen_visuals(__GLXMESAscreen *screen) -- 1.4.2