From 433196d21393449f9344e32ad2f4be9f598f2ea4 Mon Sep 17 00:00:00 2001 From: Jan Zerebecki Date: Mon, 13 Mar 2006 14:06:14 +0100 Subject: [PATCH] x11drv: Prevent out of bound access in DescribePixelFormat. --- dlls/x11drv/opengl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/x11drv/opengl.c b/dlls/x11drv/opengl.c index a2a591e2e94..eb58da9cba6 100644 --- a/dlls/x11drv/opengl.c +++ b/dlls/x11drv/opengl.c @@ -369,9 +369,9 @@ int X11DRV_DescribePixelFormat(X11DRV_PDEVICE *physDev, return 0; } - if (nCfgs < iPixelFormat) { - ERR("unexpected iPixelFormat(%d) > nFormats(%d), returns NULL\n", iPixelFormat, nCfgs); - return 0; /* unespected error */ + if (nCfgs < iPixelFormat || 1 > iPixelFormat) { + WARN("unexpected iPixelFormat(%d): not >=1 and <=nFormats(%d), returning NULL\n", iPixelFormat, nCfgs); + return 0; } ret = nCfgs; -- 2.11.4.GIT