x11drv: Prevent out of bound access in DescribePixelFormat.

This commit is contained in:
Jan Zerebecki 2006-03-13 14:06:14 +01:00 committed by Alexandre Julliard
parent f2c8a537d7
commit 433196d213
1 changed files with 3 additions and 3 deletions

View File

@ -369,9 +369,9 @@ int X11DRV_DescribePixelFormat(X11DRV_PDEVICE *physDev,
return 0; return 0;
} }
if (nCfgs < iPixelFormat) { if (nCfgs < iPixelFormat || 1 > iPixelFormat) {
ERR("unexpected iPixelFormat(%d) > nFormats(%d), returns NULL\n", iPixelFormat, nCfgs); WARN("unexpected iPixelFormat(%d): not >=1 and <=nFormats(%d), returning NULL\n", iPixelFormat, nCfgs);
return 0; /* unespected error */ return 0;
} }
ret = nCfgs; ret = nCfgs;