[gimp] Bug 788768 - GIMP crashes loading a valid truncated xcf
- From: Michael Natterer <mitch src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gimp] Bug 788768 - GIMP crashes loading a valid truncated xcf
 
- Date: Sun, 19 Nov 2017 17:30:43 +0000 (UTC)
 
commit d613842eba7fb1f96a2389e46fe795fb3e5d264e
Author: Michael Natterer <mitch gimp org>
Date:   Sun Nov 19 18:28:36 2017 +0100
    Bug 788768 - GIMP crashes loading a valid truncated xcf
    
    If the XCF is truncated in the middle of selection mask data,
    don't unref the currently loading channel because we can't
    unref the image's selection.
 app/xcf/xcf-load.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/app/xcf/xcf-load.c b/app/xcf/xcf-load.c
index a4978af..93d6b2f 100644
--- a/app/xcf/xcf-load.c
+++ b/app/xcf/xcf-load.c
@@ -1783,7 +1783,10 @@ xcf_load_channel (XcfInfo   *info,
   return channel;
 
  error:
-  g_object_unref (channel);
+  /* don't unref the selection of a partially loaded XCF */
+  if (channel != gimp_image_get_mask (image))
+    g_object_unref (channel);
+
   return NULL;
 }
 
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]