summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-11-03 14:31:53 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-11-03 14:33:24 +0000
commit1677b273af67e2b690bd21a1b43a7d9f9d5a70c1 (patch)
tree3b28ffae3b7925f69d0e087e4f6b661d4faa75bf
parent239cfb99f9697392d7c25328093e6662ad04bdc9 (diff)
sna: Skip encoding zero sized glyphs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 95a149eb..397a2d87 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -6882,9 +6882,6 @@ sna_glyph_blt(DrawablePtr drawable, GCPtr gc,
int w8 = (w + 7) >> 3;
int x1, y1, len;
- if (w == 0 || h == 0)
- goto skip;
-
len = (w8 * h + 7) >> 3 << 1;
DBG(("%s glyph: (%d, %d) x (%d[%d], %d), len=%d\n" ,__FUNCTION__,
x,y, w, w8, h, len));
@@ -7015,6 +7012,11 @@ static bool sna_set_glyph(CharInfoPtr in, CharInfoPtr out)
int stride = GLYPHWIDTHBYTESPADDED(in);
uint8_t *dst, *src;
+ if (w == 0 || h == 0) {
+ out->bits = (void *)-1;
+ return false;
+ }
+
w = (w + 7) >> 3;
out->metrics = in->metrics;