diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index 661e9f6e3..0675efdbc 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -1264,11 +1264,15 @@ XineramaGetImageData(DrawablePtr *pDrawables, for (j = 0, index = (pitch * y) + x, index2 = 0; j < h; j++, index += pitch, index2 += ScratchPitch) { if (w) { - if (!shift) + if (!shift) { + assert(ScratchMem); memcpy(data + index, ScratchMem + index2, w); - else + } + else { + assert(ScratchMem); CopyBits(data + index, shift, ScratchMem + index2, w); + } } if (leftover) { @@ -1288,6 +1292,7 @@ XineramaGetImageData(DrawablePtr *pDrawables, w *= j; for (j = 0; j < h; j++) { + assert(ScratchMem); memcpy(data + (pitch * (y + j)) + x, ScratchMem + (ScratchPitch * j), w); } diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c index 4008541b6..7ceb4d84a 100644 --- a/Xext/panoramiXprocs.c +++ b/Xext/panoramiXprocs.c @@ -1136,7 +1136,7 @@ PanoramiXCopyArea(ClientPtr client) } free(data); - if (pGC->graphicsExposures) { + if (pGC && pGC->graphicsExposures) { RegionRec rgn; int dx, dy; BoxRec sourceBox;