Deal with font_buffer_create() failures

This commit is contained in:
Consolatis 2022-05-26 15:34:08 +02:00 committed by Johan Malm
parent 94f199e3c5
commit bda48da68d
3 changed files with 42 additions and 12 deletions

View file

@ -74,6 +74,11 @@ font_buffer_create(struct lab_data_buffer **buffer, int max_width,
}
/* TODO: scale */
*buffer = buffer_create_cairo(rect.width, rect.height, 1, true);
if (!*buffer) {
wlr_log(WLR_ERROR, "Failed to create font buffer of size %dx%d",
rect.width, rect.height);
return;
}
cairo_t *cairo = (*buffer)->cairo;
cairo_surface_t *surf = cairo_get_target(cairo);