[evince] libdocument: Add more sanity checks to ev-document-misc.
- From: Jose Aliste <jaliste src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] libdocument: Add more sanity checks to ev-document-misc.
- Date: Tue, 30 Nov 2010 14:09:25 +0000 (UTC)
commit cae38b012050870eef820330a5902f94f262ffb5
Author: José Aliste <jaliste src gnome org>
Date: Fri Nov 26 14:45:46 2010 -0300
libdocument: Add more sanity checks to ev-document-misc.
See bug #572061.
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 e710edb..f1a3095 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);
+
return gdk_pixbuf_get_from_surface (surface,
0, 0,
cairo_image_surface_get_width (surface),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]