summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-06-28 20:25:46 +0100
committerOwain G. Ainsworth <oga@openbsd.org>2011-07-12 17:59:43 +0100
commit88f08fab7f19077a17c78dad5cf9ea924874755a (patch)
tree10067ab249dac2807cf0024b22dd2f4745dffdb5
parent6a304676f10fc089b20f6523d14ab331109c11d8 (diff)
uxa/glyphs: Fallback instead of crashing on large strings
Not ideal, but being slow is a major improvement over losing data. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36860 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> (cherry picked from commit 18d08e49d270b7a05f14a309759c9315e5ab9679) Signed-off-by: Owain G. Ainsworth <oga@openbsd.org>
-rw-r--r--uxa/uxa-glyphs.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c
index 0f5dddad..7b2edea4 100644
--- a/uxa/uxa-glyphs.c
+++ b/uxa/uxa-glyphs.c
@@ -937,6 +937,11 @@ uxa_glyphs_via_mask(CARD8 op,
if (!pixmap)
return 1;
+ if (!uxa_pixmap_is_offscreen(pixmap)) {
+ screen->DestroyPixmap(pixmap);
+ return -1;
+ }
+
uxa_clear_pixmap(screen, uxa_screen, pixmap);
component_alpha = NeedsComponent(maskFormat->format);
@@ -1129,6 +1134,11 @@ fallback:
if (!pixmap)
return;
+ if (!uxa_pixmap_is_offscreen(pixmap)) {
+ screen->DestroyPixmap(pixmap);
+ goto fallback;
+ }
+
gc = GetScratchGC(depth, screen);
if (!gc) {
screen->DestroyPixmap(pixmap);