Xext: panoramix: extra safety checks
Even though risk of being actually hit is minimal, better having some extra safety checks instead of segfaulting, just in case. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
3f7370d53f
commit
2b3bbce30b
|
@ -1264,12 +1264,16 @@ 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) {
|
||||
data[index + w] |=
|
||||
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -1136,7 +1136,7 @@ PanoramiXCopyArea(ClientPtr client)
|
|||
}
|
||||
free(data);
|
||||
|
||||
if (pGC->graphicsExposures) {
|
||||
if (pGC && pGC->graphicsExposures) {
|
||||
RegionRec rgn;
|
||||
int dx, dy;
|
||||
BoxRec sourceBox;
|
||||
|
|
Loading…
Reference in New Issue