[gimp] app: do not crash when opening a file with unimplemented compression



commit d4dba427acbf6f0c4f17343b6431c2e461110810
Author: Jehan <jehan girinstud io>
Date:   Mon Sep 15 16:11:45 2014 +0200

    app: do not crash when opening a file with unimplemented compression
    
    Our code was planning zlib and fractal compressions for eons, but would
    crash against a file which would be actually using these. It means that
    if we implement one of these compressions for 2.10, anyone with GIMP 2.8
    (and likely earlier too) would crash when opening a legit file using the
    new compressions. That's very bad.
    Never use g_error() in non-fatale, expected, situations!

 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 85f05e3..ffe9f69 100644
--- a/app/xcf/xcf-load.c
+++ b/app/xcf/xcf-load.c
@@ -1780,11 +1780,15 @@ xcf_load_level (XcfInfo    *info,
             fail = TRUE;
           break;
         case COMPRESS_ZLIB:
-          g_error ("xcf: zlib compression unimplemented");
+          g_warning ("xcf: zlib compression unimplemented");
           fail = TRUE;
           break;
         case COMPRESS_FRACTAL:
-          g_error ("xcf: fractal compression unimplemented");
+          g_warning ("xcf: fractal compression unimplemented");
+          fail = TRUE;
+          break;
+        default:
+          g_warning ("xcf: unknown compression");
           fail = TRUE;
           break;
         }


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