[gdk-pixbuf] lib: Make gdk_pixbuf_fill() fail if pixbuf doesn't have storage



commit 049787302b6d6d6c24665b36db290f403c3540bc
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Oct 24 11:08:45 2014 +0200

    lib: Make gdk_pixbuf_fill() fail if pixbuf doesn't have storage
    
    This fixes a crash when using Python's "new" keyword instead of the
    constructors exported by GdkPixbuf.
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=658702

 gdk-pixbuf/gdk-pixbuf.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/gdk-pixbuf/gdk-pixbuf.c b/gdk-pixbuf/gdk-pixbuf.c
index ce3c232..ca7c475 100644
--- a/gdk-pixbuf/gdk-pixbuf.c
+++ b/gdk-pixbuf/gdk-pixbuf.c
@@ -837,6 +837,7 @@ gdk_pixbuf_fill (GdkPixbuf *pixbuf,
         guint w, h;
 
         g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
+        g_return_if_fail (pixbuf->pixels || pixbuf->bytes);
 
         if (pixbuf->width == 0 || pixbuf->height == 0)
                 return;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]