Commit 6f6e8ea9 authored by Sebastian Ramacher's avatar Sebastian Ramacher

Check errors of cairo_image_surface_create properly

Signed-off-by: Sebastian Ramacher's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent f240bdb9
......@@ -130,6 +130,11 @@ cb_print_draw_page(GtkPrintOperation* print_operation, GtkPrintContext*
gtk_print_operation_cancel(print_operation);
return;
}
if (cairo_surface_status(surface) != CAIRO_STATUS_SUCCESS) {
gtk_print_operation_cancel(print_operation);
cairo_surface_destroy(surface);
return;
}
cairo_t* temp_cairo = cairo_create(surface);
if (cairo == NULL) {
......
......@@ -746,6 +746,10 @@ render(render_job_t* job, ZathuraRenderRequest* request, ZathuraRenderer* render
if (surface == NULL) {
return false;
}
if (cairo_surface_status(surface) != CAIRO_STATUS_SUCCESS) {
cairo_surface_destroy(surface);
return false;
}
cairo_t* cairo = cairo_create(surface);
if (cairo == NULL) {
......
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