summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart R. Anderson <anderson@netsweng.com>2005-07-23 17:49:45 +0000
committerStuart R. Anderson <anderson@netsweng.com>2005-07-23 17:49:45 +0000
commitd8a1241a24d75c258548875350bff4d0acc795ab (patch)
treebd403f00820eb1c3b7f91b0f2153a875fc7d0688
parent93d29b4554d26b22ca43311264f85ea8e14804c2 (diff)
Add a safety check to catch when numDepths GCperDepthexceeps MAXFORMATS
-rw-r--r--dix/gc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/dix/gc.c b/dix/gc.c
index dc71b82d2..cb21e09fd 100644
--- a/dix/gc.c
+++ b/dix/gc.c
@@ -1016,6 +1016,9 @@ CreateGCperDepth(int screenNum)
if (!(ppGC[0] = CreateScratchGC(pScreen, 1)))
return FALSE;
ppGC[0]->graphicsExposures = FALSE;
+ /* Make sure we don't overflow GCperDepth[] */
+ if( pScreen->numDepths > MAXFORMATS )
+ return FALSE;
pDepth = pScreen->allowedDepths;
for (i=0; i<pScreen->numDepths; i++, pDepth++)