mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 08:16:00 +01:00
Check errors of cairo_image_surface_create properly
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
f240bdb93c
commit
6f6e8ea94e
2 changed files with 9 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue