[lasem] mathml: don't try to ref a NULL object



commit 263e50d724e4bbc673020841f825fc2216c7de38
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Fri May 24 10:48:52 2019 +0200

    mathml: don't try to ref a NULL object

 src/lsmsvgfilterimage.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/lsmsvgfilterimage.c b/src/lsmsvgfilterimage.c
index 5ded3e4..f624d1a 100644
--- a/src/lsmsvgfilterimage.c
+++ b/src/lsmsvgfilterimage.c
@@ -53,7 +53,7 @@ lsm_svg_filter_image_apply  (LsmSvgFilterPrimitive *self, LsmSvgView *view,
 {
        LsmSvgFilterImage *filter = LSM_SVG_FILTER_IMAGE (self);
 
-       /* TODO href can also be a reference to an element */ 
+       /* TODO href can also be a reference to an element */
        /* TODO this code can be factorized with the one of <image> */
 
        if (filter->pixbuf == NULL) {
@@ -77,7 +77,9 @@ lsm_svg_filter_image_apply  (LsmSvgFilterPrimitive *self, LsmSvgView *view,
                                gdk_pixbuf_loader_close (loader, NULL);
 
                                filter->pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
-                               g_object_ref (filter->pixbuf);
+
+                               if (filter->pixbuf != NULL)
+                                       g_object_ref (filter->pixbuf);
 
                                g_object_unref (loader);
                        } else


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