mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-11 00:03:49 +01:00
Check memory allocation
This commit is contained in:
parent
2205156738
commit
b0c068f3cb
@ -623,7 +623,14 @@ draw_thumbnail_image(cairo_surface_t* surface)
|
||||
|
||||
cairo_surface_t *thumbnail;
|
||||
thumbnail = cairo_surface_create_similar(surface, CAIRO_CONTENT_COLOR, width, height);
|
||||
if (thumbnail == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
cairo_t *cr = cairo_create(thumbnail);
|
||||
if (cr == NULL) {
|
||||
cairo_surface_destroy(thumbnail);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cairo_scale(cr, scale, scale);
|
||||
cairo_set_source_surface(cr, surface, 0, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user