diff options
author | infirit <[email protected]> | 2014-12-09 15:23:05 +0100 |
---|---|---|
committer | infirit <[email protected]> | 2014-12-09 23:02:28 +0100 |
commit | bf0fdfa485cef54841309a467063e9fadaeb9d38 (patch) | |
tree | bc6caea9b8070a4536b339d4a8eb8c41858d8e28 | |
parent | 510b42f68f3172ff24d4efc605a0527e0cd29e76 (diff) | |
download | atril-bf0fdfa485cef54841309a467063e9fadaeb9d38.tar.bz2 atril-bf0fdfa485cef54841309a467063e9fadaeb9d38.tar.xz |
libdocument: Add more sanity checks to ev-document-misc
Taken from evince commit: cae38b012050870eef820330a5902f94f262ffb5
From: José Aliste <[email protected]>
Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=572061
-rw-r--r-- | libdocument/ev-document-misc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libdocument/ev-document-misc.c b/libdocument/ev-document-misc.c index 6099b7fa..e7398dee 100644 --- a/libdocument/ev-document-misc.c +++ b/libdocument/ev-document-misc.c @@ -180,6 +180,8 @@ ev_document_misc_surface_from_pixbuf (GdkPixbuf *pixbuf) cairo_surface_t *surface; cairo_t *cr; + g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL); + surface = cairo_image_surface_create (gdk_pixbuf_get_has_alpha (pixbuf) ? CAIRO_FORMAT_ARGB32 : CAIRO_FORMAT_RGB24, gdk_pixbuf_get_width (pixbuf), @@ -195,6 +197,8 @@ ev_document_misc_surface_from_pixbuf (GdkPixbuf *pixbuf) GdkPixbuf * ev_document_misc_pixbuf_from_surface (cairo_surface_t *surface) { + g_return_val_if_fail (surface, NULL); + GdkPixbuf *pixbuf; cairo_surface_t *image; cairo_t *cr; |