diff options
author | Richard Hughes <richard@hughsie.com> | 2015-03-11 14:16:26 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2015-03-11 14:16:26 +0000 |
commit | 55c5e050f5a6f9ba4eb5f1043b97383922ce6cc7 (patch) | |
tree | 33aa7b974d8c47d39880768def174c167e399353 | |
parent | 35091c0459d5a7b27911bc47a0d60b833ca41b36 (diff) | |
download | appstream-glib-55c5e050f5a6f9ba4eb5f1043b97383922ce6cc7.tar.gz |
trivial: Fix a potential crash spotted by clang
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-font.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libappstream-builder/plugins/asb-plugin-font.c b/libappstream-builder/plugins/asb-plugin-font.c index d343127..f85c7cc 100644 --- a/libappstream-builder/plugins/asb-plugin-font.c +++ b/libappstream-builder/plugins/asb-plugin-font.c @@ -350,6 +350,12 @@ asb_font_get_pixbuf (FT_Face ft_face, cairo_set_source_rgb (cr, 0.0, 0.0, 0.0); cairo_show_text (cr, text); pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0, width, height); + if (pixbuf == NULL) { + g_set_error_literal (error, + ASB_PLUGIN_ERROR, + ASB_PLUGIN_ERROR_FAILED, + "Could not get font pixbuf"); + } cairo_destroy (cr); cairo_font_face_destroy (font_face); |