mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-26 13:30:06 +01:00
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: Eric Anholt <eric@anholt.net> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
parent
de959ec939
commit
a6b05d10da
1 changed files with 8 additions and 1 deletions
|
|
@ -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,
|
||||
glamor_priv->glyph_atlas_dim, format->depth,
|
||||
GLAMOR_CREATE_FBO_NO_FBO);
|
||||
if (!glamor_pixmap_has_fbo(atlas->atlas)) {
|
||||
glamor_destroy_pixmap(atlas->atlas);
|
||||
atlas->atlas = NULL;
|
||||
}
|
||||
atlas->x = 0;
|
||||
atlas->y = 0;
|
||||
atlas->row_height = 0;
|
||||
|
|
@ -420,8 +424,11 @@ glamor_composite_glyphs(CARD8 op,
|
|||
glyph_atlas->atlas = NULL;
|
||||
}
|
||||
}
|
||||
if (!glyph_atlas->atlas)
|
||||
if (!glyph_atlas->atlas) {
|
||||
glamor_glyph_atlas_init(screen, glyph_atlas);
|
||||
if (!glyph_atlas->atlas)
|
||||
goto bail_one;
|
||||
}
|
||||
glamor_glyph_add(glyph_atlas, glyph_draw);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue