summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-06-28 20:25:46 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-06-28 20:26:48 +0100
commit18d08e49d270b7a05f14a309759c9315e5ab9679 (patch)
tree4d44c6b7d033dfebba4fccd4bb56cf541927593f
parent95866bd6bdaeb612732fd43ec1b93e088763086e (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>
-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);