From 12b4ea88d70e3033fcc78628e7b134055bccc75d Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 14 May 2025 13:06:35 +0200 Subject: [PATCH] (!1975) glamor: BUG_* checks on NULL atlas If this happens, we really have a bug, so better spit out a warning instead of just segfault'ing. Signed-off-by: Enrico Weigelt, metux IT consult --- glamor/glamor_composite_glyphs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/glamor/glamor_composite_glyphs.c b/glamor/glamor_composite_glyphs.c index 05c089e4e..4c12fb5af 100644 --- a/glamor/glamor_composite_glyphs.c +++ b/glamor/glamor_composite_glyphs.c @@ -126,6 +126,8 @@ glamor_copy_glyph(PixmapPtr glyph_pixmap, static Bool glamor_glyph_atlas_init(ScreenPtr screen, struct glamor_glyph_atlas *atlas) { + BUG_RETURN_VAL(!atlas, FALSE); + glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); PictFormatPtr format = atlas->format; @@ -435,6 +437,7 @@ glamor_composite_glyphs(CARD8 op, /* Glyph not cached in current atlas? */ + BUG_RETURN(!glyph_atlas); if (_X_UNLIKELY(glyph_priv->serial != glyph_atlas->serial)) { if (!glamor_glyph_can_add(glyph_atlas, glyph_atlas_dim, glyph_draw)) { if (glyphs_queued) {