[Xfce4-commits] [xfce/xfdesktop] 01/01: Prevent a crash in the backdrop loader (Bug #12339)

noreply at xfce.org noreply at xfce.org
Sat Jan 30 04:58:53 CET 2016


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository xfce/xfdesktop.

commit 30da874e6218dc2a044180a1ef14893643077cd6
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Tue Jan 26 04:39:25 2016 +0300

    Prevent a crash in the backdrop loader (Bug #12339)
    
    The loader needs to check if the loading has been canceled or has
    invalid data.
---
 src/xfce-backdrop.c |   26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/src/xfce-backdrop.c b/src/xfce-backdrop.c
index b4c884c..9d3a217 100644
--- a/src/xfce-backdrop.c
+++ b/src/xfce-backdrop.c
@@ -1658,9 +1658,12 @@ xfce_backdrop_image_data_release(XfceBackdropImageData *image_data)
     if(!image_data)
         return;
 
-    /* Only set the backdrop's image_data to NULL if it's current */
-    if(image_data->backdrop->priv->image_data == image_data)
-        image_data->backdrop->priv->image_data = NULL;
+    if(XFCE_IS_BACKDROP(image_data->backdrop)) {
+        /* Only set the backdrop's image_data to NULL if it's current */
+        if(image_data->backdrop->priv->image_data == image_data) {
+            image_data->backdrop->priv->image_data = NULL;
+        }
+    }
 
     if(image_data->cancellable)
         g_object_unref(image_data->cancellable);
@@ -1773,6 +1776,23 @@ xfce_backdrop_loader_size_prepared_cb(GdkPixbufLoader *loader,
 
     TRACE("entering");
 
+    if(image_data == NULL)
+        return;
+
+    /* canceled? quit now */
+    if(g_cancellable_is_cancelled(image_data->cancellable)) {
+        xfce_backdrop_image_data_release(image_data);
+        g_free(image_data);
+        return;
+    }
+
+    /* invalid backdrop? quit */
+    if(!XFCE_IS_BACKDROP(backdrop)) {
+        xfce_backdrop_image_data_release(image_data);
+        g_free(image_data);
+        return;
+    }
+
     if(backdrop->priv->image_style == XFCE_BACKDROP_IMAGE_INVALID) {
         g_warning("Invalid image style, setting to XFCE_BACKDROP_IMAGE_ZOOMED");
         backdrop->priv->image_style = XFCE_BACKDROP_IMAGE_ZOOMED;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list