Commit a6b05d10 authored by Eric Anholt's avatar Eric Anholt

glamor: Fix crashes when the glyph atlas allocation fails.

We already have a fallback path, so we just need to jump to it when we
hit the failure.
Signed-off-by: 's avatarEric Anholt <eric@anholt.net>
Reviewed-by: 's avatarMichel Dänzer <michel.daenzer@amd.com>
parent de959ec9
...@@ -127,6 +127,10 @@ glamor_glyph_atlas_init(ScreenPtr screen, struct glamor_glyph_atlas *atlas) ...@@ -127,6 +127,10 @@ glamor_glyph_atlas_init(ScreenPtr screen, struct glamor_glyph_atlas *atlas)
atlas->atlas = glamor_create_pixmap(screen, glamor_priv->glyph_atlas_dim, atlas->atlas = glamor_create_pixmap(screen, glamor_priv->glyph_atlas_dim,
glamor_priv->glyph_atlas_dim, format->depth, glamor_priv->glyph_atlas_dim, format->depth,
GLAMOR_CREATE_FBO_NO_FBO); GLAMOR_CREATE_FBO_NO_FBO);
if (!glamor_pixmap_has_fbo(atlas->atlas)) {
glamor_destroy_pixmap(atlas->atlas);
atlas->atlas = NULL;
}
atlas->x = 0; atlas->x = 0;
atlas->y = 0; atlas->y = 0;
atlas->row_height = 0; atlas->row_height = 0;
...@@ -420,8 +424,11 @@ glamor_composite_glyphs(CARD8 op, ...@@ -420,8 +424,11 @@ glamor_composite_glyphs(CARD8 op,
glyph_atlas->atlas = NULL; glyph_atlas->atlas = NULL;
} }
} }
if (!glyph_atlas->atlas) if (!glyph_atlas->atlas) {
glamor_glyph_atlas_init(screen, glyph_atlas); glamor_glyph_atlas_init(screen, glyph_atlas);
if (!glyph_atlas->atlas)
goto bail_one;
}
glamor_glyph_add(glyph_atlas, glyph_draw); glamor_glyph_add(glyph_atlas, glyph_draw);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment