diff --git a/kitty/fonts.c b/kitty/fonts.c index 801f0c0dc..f2530c995 100644 --- a/kitty/fonts.c +++ b/kitty/fonts.c @@ -1260,7 +1260,6 @@ send_prerendered_sprites_for_window(OSWindow *w) { FontGroup *fg = (FontGroup*)w->fonts_data; if (!fg->sprite_map) { fg->sprite_map = alloc_sprite_map(fg->cell_width, fg->cell_height); - if (!fg->sprite_map) fatal("Out of memory allocating a sprite map"); send_prerendered_sprites(fg); } } diff --git a/kitty/shaders.c b/kitty/shaders.c index 8a82dbd8f..28c312c0c 100644 --- a/kitty/shaders.c +++ b/kitty/shaders.c @@ -37,12 +37,11 @@ alloc_sprite_map(unsigned int cell_width, unsigned int cell_height) { sprite_tracker_set_limits(max_texture_size, max_array_texture_layers); } SpriteMap *ans = calloc(1, sizeof(SpriteMap)); - if (ans) { - *ans = NEW_SPRITE_MAP; - ans->max_texture_size = max_texture_size; - ans->max_array_texture_layers = max_array_texture_layers; - ans->cell_width = cell_width; ans->cell_height = cell_height; - } + if (!ans) fatal("Out of memory allocating a sprite map"); + *ans = NEW_SPRITE_MAP; + ans->max_texture_size = max_texture_size; + ans->max_array_texture_layers = max_array_texture_layers; + ans->cell_width = cell_width; ans->cell_height = cell_height; return (SPRITE_MAP_HANDLE)ans; }