Add a safety check to catch when numDepths GCperDepthexceeps MAXFORMATS
This commit is contained in:
parent
93d29b4554
commit
d8a1241a24
3
dix/gc.c
3
dix/gc.c
|
@ -1016,6 +1016,9 @@ CreateGCperDepth(int screenNum)
|
||||||
if (!(ppGC[0] = CreateScratchGC(pScreen, 1)))
|
if (!(ppGC[0] = CreateScratchGC(pScreen, 1)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
ppGC[0]->graphicsExposures = FALSE;
|
ppGC[0]->graphicsExposures = FALSE;
|
||||||
|
/* Make sure we don't overflow GCperDepth[] */
|
||||||
|
if( pScreen->numDepths > MAXFORMATS )
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
pDepth = pScreen->allowedDepths;
|
pDepth = pScreen->allowedDepths;
|
||||||
for (i=0; i<pScreen->numDepths; i++, pDepth++)
|
for (i=0; i<pScreen->numDepths; i++, pDepth++)
|
||||||
|
|
Loading…
Reference in New Issue