[PATCH xserver 3/5] glamor: Fix rendering when core font texture allocation fails.

Eric Anholt eric at anholt.net
Fri Nov 6 12:21:46 PST 2015


Signed-off-by: Eric Anholt <eric at anholt.net>
---
 glamor/glamor_font.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/glamor/glamor_font.c b/glamor/glamor_font.c
index 6b3a16a..6753d50 100644
--- a/glamor/glamor_font.c
+++ b/glamor/glamor_font.c
@@ -127,8 +127,13 @@ glamor_font_get(ScreenPtr screen, FontPtr font)
     }
 
     glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+
+    glamor_priv->suppress_gl_out_of_memory_logging = true;
     glTexImage2D(GL_TEXTURE_2D, 0, GL_R8UI, overall_width, overall_height,
                  0, GL_RED_INTEGER, GL_UNSIGNED_BYTE, bits);
+    glamor_priv->suppress_gl_out_of_memory_logging = false;
+    if (glGetError() == GL_OUT_OF_MEMORY)
+        return NULL;
 
     free(bits);
 
-- 
2.6.2



More information about the xorg-devel mailing list