Commit 433196d2 authored by Jan Zerebecki's avatar Jan Zerebecki Committed by Alexandre Julliard

x11drv: Prevent out of bound access in DescribePixelFormat.

parent f2c8a537
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment