From ff8ef975df9cd99ec6f0b8b8047445091bf35ef0 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 5 Nov 2015 15:13:55 -0800 Subject: [PATCH] glamor: Fix rendering when core font texture allocation fails. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Eric Anholt Reviewed-by: Michel Dänzer --- glamor/glamor_font.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/glamor/glamor_font.c b/glamor/glamor_font.c index 6b3a16abc..6753d5089 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);