[gimp] Bug 730396: GIMP crashes loading a XCF it saved



commit 87596258d0f14d62f1411b5c421fc5671ac5371e
Author: Massimo Valentini <mvalentini src gnome org>
Date:   Sat Jun 7 16:40:39 2014 +0200

    Bug 730396: GIMP crashes loading a XCF it saved
    
    stop reading reached eof

 app/xcf/xcf-load.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/app/xcf/xcf-load.c b/app/xcf/xcf-load.c
index 883f39d..b8ed336 100644
--- a/app/xcf/xcf-load.c
+++ b/app/xcf/xcf-load.c
@@ -2313,8 +2313,12 @@ xcf_skip_unknown_prop (XcfInfo *info,
         return FALSE;
 
       amount = MIN (16, size);
-      info->cp += xcf_read_int8 (info->input, buf, amount);
-      size -= MIN (16, amount);
+      amount = xcf_read_int8 (info->input, buf, amount);
+      if (amount == 0)
+        return FALSE;
+
+      info->cp += amount;
+      size -= amount;
     }
 
   return TRUE;


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