dix: Allow NULL stipple in ChangeGC
miOpqStipDrawable resets the stipple after painting. When that stipple was NULL, ChangeGC needs to handle that and not crash. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-off-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
2e040f41de
commit
ae87b53615
6
dix/gc.c
6
dix/gc.c
|
@ -261,11 +261,13 @@ ChangeGC(ClientPtr client, GC * pGC, BITS32 mask, ChangeGCValPtr pUnion)
|
||||||
case GCStipple:
|
case GCStipple:
|
||||||
NEXT_PTR(PixmapPtr, pPixmap);
|
NEXT_PTR(PixmapPtr, pPixmap);
|
||||||
|
|
||||||
if ((pPixmap->drawable.depth != 1) ||
|
if (pPixmap && ((pPixmap->drawable.depth != 1) ||
|
||||||
(pPixmap->drawable.pScreen != pGC->pScreen)) {
|
(pPixmap->drawable.pScreen != pGC->pScreen)))
|
||||||
|
{
|
||||||
error = BadMatch;
|
error = BadMatch;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if (pPixmap)
|
||||||
pPixmap->refcnt++;
|
pPixmap->refcnt++;
|
||||||
if (pGC->stipple)
|
if (pGC->stipple)
|
||||||
(*pGC->pScreen->DestroyPixmap) (pGC->stipple);
|
(*pGC->pScreen->DestroyPixmap) (pGC->stipple);
|
||||||
|
|
Loading…
Reference in New Issue