From 717c7492a0f6ba3fb3eabda33515881eef314155 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 7 Oct 2008 02:38:44 +1000 Subject: [PATCH] exa: 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. --- exa/exa_glyphs.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/exa/exa_glyphs.c b/exa/exa_glyphs.c index 2acc891f3..169763f76 100644 --- a/exa/exa_glyphs.c +++ b/exa/exa_glyphs.c @@ -871,12 +871,14 @@ exaGlyphs (CARD8 op, list++; } - if (maskFormat) - exaGlyphsToMask(pMask, &buffer); - else - exaGlyphsToDst(op, pSrc, pDst, &buffer, - xSrc, ySrc, xDst, yDst); - + if (buffer.count) { + if (maskFormat) + exaGlyphsToMask(pMask, &buffer); + else + exaGlyphsToDst(op, pSrc, pDst, &buffer, + xSrc, ySrc, xDst, yDst); + } + if (maskFormat) { x = extents.x1;