[PATCH] glamor: fallback if font is too large for FBO size.
Dave Airlie
airlied at gmail.com
Sun Jan 10 23:04:00 PST 2016
From: Dave Airlie <airlied at redhat.com>
running xfontsel on haswell here, with a max texture size
of 8kx8k, one font wants 9711 height. This fallsback to
sw in this case.
A proper solution probably involves using an array texture.
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
glamor/glamor_font.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/glamor/glamor_font.c b/glamor/glamor_font.c
index 6753d50..bda1b58 100644
--- a/glamor/glamor_font.c
+++ b/glamor/glamor_font.c
@@ -80,6 +80,10 @@ glamor_font_get(ScreenPtr screen, FontPtr font)
overall_width = glyph_width_bytes * num_cols;
overall_height = glyph_height * num_rows;
+ if (overall_width > glamor_priv->max_fbo_size ||
+ overall_height > glamor_priv->max_fbo_size) {
+ return NULL;
+ }
bits = malloc(overall_width * overall_height);
if (!bits)
return NULL;
--
2.4.3
More information about the xorg-devel
mailing list