Check memory allocation

This commit is contained in:
Lingzhu Xiang 2014-10-28 03:44:26 -04:00
parent 2205156738
commit b0c068f3cb

View File

@ -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);