From 293f6232c6c0ce12802a2123edfab4551d25e266 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 3 Dec 2008 16:51:25 -0800 Subject: uxa: don't call composite routines with no buffer. We can get a case with gnome-terminal + links, where we get two arrays of glyphs all with 0 width and 0 heights in them. If this happens we manage to get to this case without any buffer setup and segfault. (cherry picked from commit 717c7492a0f6ba3fb3eabda33515881eef314155) --- uxa/uxa-glyphs.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'uxa') diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c index dc518568..dd26362e 100644 --- a/uxa/uxa-glyphs.c +++ b/uxa/uxa-glyphs.c @@ -858,13 +858,15 @@ uxa_glyphs (CARD8 op, } list++; } - - if (maskFormat) - uxa_glyphs_to_mask(pMask, &buffer); - else - uxa_glyphs_to_dst(op, pSrc, pDst, &buffer, - xSrc, ySrc, xDst, yDst); - + + if (buffer.count) { + if (maskFormat) + uxa_glyphs_to_mask(pMask, &buffer); + else + uxa_glyphs_to_dst(op, pSrc, pDst, &buffer, + xSrc, ySrc, xDst, yDst); + } + if (maskFormat) { x = extents.x1; -- cgit v1.2.3