From 363ea0873bc00467850653144ed0a2910c91618d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 4 Feb 2014 08:51:17 +0000 Subject: [PATCH] sna/glyphs: Reset composite state between switching glyph formats One path uses the mask channel, the other does not. We cannot rely on overwriting all reused state in this case, and so we must clear the composite state prior to use each time. Reported-by: Arkadiusz Miskiewicz Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74494 Signed-off-by: Chris Wilson --- src/sna/sna_glyphs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c index d06d52a..c72c5e5 100644 --- a/src/sna/sna_glyphs.c +++ b/src/sna/sna_glyphs.c @@ -1306,7 +1306,6 @@ next_image: if (!clear_pixmap(sna, pixmap)) goto err_mask; - memset(&tmp, 0, sizeof(tmp)); glyph_atlas = NULL; do { int n = list->len; @@ -1346,6 +1345,8 @@ next_image: __FUNCTION__, (int)p->atlas->format, (int)(format->depth << 24 | format->format))); + + memset(&tmp, 0, sizeof(tmp)); if (p->atlas->format == (format->depth << 24 | format->format)) { ok = sna->render.composite(sna, PictOpAdd, p->atlas, NULL, mask, -- 1.7.9.5