Support querying of number of visuals without reporting an error or

crashing.
This commit is contained in:
Lionel Ulmer 2002-05-24 21:14:16 +00:00 committed by Alexandre Julliard
parent 9d9cf72a70
commit 236893c620

View file

@ -176,6 +176,11 @@ int X11DRV_DescribePixelFormat(X11DRV_PDEVICE *physDev,
int rb,gb,bb,ab;
TRACE("(%p,%d,%d,%p)\n", physDev, iPixelFormat, nBytes, ppfd);
if (ppfd == NULL) {
/* The application is only querying the number of visuals */
return MAX_PIXELFORMATS;
}
if (nBytes < sizeof(PIXELFORMATDESCRIPTOR)) {
ERR("Wrong structure size !\n");