mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 14:56:00 +01:00
Check memory allocation
This commit is contained in:
parent
2205156738
commit
b0c068f3cb
1 changed files with 7 additions and 0 deletions
|
@ -623,7 +623,14 @@ draw_thumbnail_image(cairo_surface_t* surface)
|
||||||
|
|
||||||
cairo_surface_t *thumbnail;
|
cairo_surface_t *thumbnail;
|
||||||
thumbnail = cairo_surface_create_similar(surface, CAIRO_CONTENT_COLOR, width, height);
|
thumbnail = cairo_surface_create_similar(surface, CAIRO_CONTENT_COLOR, width, height);
|
||||||
|
if (thumbnail == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
cairo_t *cr = cairo_create(thumbnail);
|
cairo_t *cr = cairo_create(thumbnail);
|
||||||
|
if (cr == NULL) {
|
||||||
|
cairo_surface_destroy(thumbnail);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
cairo_scale(cr, scale, scale);
|
cairo_scale(cr, scale, scale);
|
||||||
cairo_set_source_surface(cr, surface, 0, 0);
|
cairo_set_source_surface(cr, surface, 0, 0);
|
||||||
|
|
Loading…
Reference in a new issue