Commit b0c068f3 authored by Lingzhu Xiang's avatar Lingzhu Xiang

Check memory allocation

parent 22051567
......@@ -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);
......
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