[gnome-software/gnome-3-22] Fix a crash when the surface creation fails



commit 2a0b492615bf2992e18f5d1628f357d44bd42ea9
Author: Richard Hughes <richard hughsie com>
Date:   Thu Dec 1 20:29:24 2016 +0000

    Fix a crash when the surface creation fails
    
    Not sure how this can happen, but it's happened for 12 people.
    
    Resolves: 
https://retrace.fedoraproject.org/faf/problems/bthash/?bth=1d1d1e34f2ecaa57bdc720a023a930d2ea83412f

 src/gs-common.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-common.c b/src/gs-common.c
index 8f7f8bc..336b22c 100644
--- a/src/gs-common.c
+++ b/src/gs-common.c
@@ -372,6 +372,8 @@ gs_image_set_from_pixbuf_with_scale (GtkImage *image, const GdkPixbuf *pixbuf, g
 {
        cairo_surface_t *surface;
        surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, scale, NULL);
+       if (surface == NULL)
+               return;
        gtk_image_set_from_surface (image, surface);
        cairo_surface_destroy (surface);
 }


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