Signed-off-by: Eric Anholt <e...@anholt.net> --- Xext/xvmain.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/Xext/xvmain.c b/Xext/xvmain.c index a3fb711..d84708b 100644 --- a/Xext/xvmain.c +++ b/Xext/xvmain.c @@ -1096,22 +1096,26 @@ XvFillColorKey(DrawablePtr pDraw, CARD32 key, RegionPtr region) GCPtr gc; gc = GetScratchGC(pDraw->depth, pScreen); + if (!gc) + return; + pval[0].val = key; pval[1].val = IncludeInferiors; (void) ChangeGC(NullClient, gc, GCForeground | GCSubwindowMode, pval); ValidateGC(pDraw, gc); rects = malloc(nbox * sizeof(xRectangle)); + if (rects) { + for (i = 0; i < nbox; i++, pbox++) { + rects[i].x = pbox->x1 - pDraw->x; + rects[i].y = pbox->y1 - pDraw->y; + rects[i].width = pbox->x2 - pbox->x1; + rects[i].height = pbox->y2 - pbox->y1; + } - for (i = 0; i < nbox; i++, pbox++) { - rects[i].x = pbox->x1 - pDraw->x; - rects[i].y = pbox->y1 - pDraw->y; - rects[i].width = pbox->x2 - pbox->x1; - rects[i].height = pbox->y2 - pbox->y1; - } - - (*gc->ops->PolyFillRect) (pDraw, gc, nbox, rects); + (*gc->ops->PolyFillRect) (pDraw, gc, nbox, rects); - free(rects); + free(rects); + } FreeScratchGC(gc); } -- 2.0.1 _______________________________________________ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel