[gimp/gimp-2-8] file-cel: make generating thumbnails more robust



commit f0dae90f23c9e82d4bf1cab01f820f37627ba23e
Author: Nils Philippsen <nils redhat com>
Date:   Thu Sep 6 12:42:48 2012 +0200

    file-cel: make generating thumbnails more robust
    
    Ran non-interactively, file-cel could crash e.g. if loading an image to
    generate a thumbnail, because there is no way to specify a palette file
    in that case.
    (cherry picked from commit 96ce2c936dd2fb8cfbfcbadf95d667b7d6d47ca2)

 plug-ins/common/file-cel.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/plug-ins/common/file-cel.c b/plug-ins/common/file-cel.c
index 6292d7a..f1aed6f 100644
--- a/plug-ins/common/file-cel.c
+++ b/plug-ins/common/file-cel.c
@@ -186,7 +186,10 @@ run (const gchar      *name,
       if (run_mode == GIMP_RUN_NONINTERACTIVE)
         {
           palette_file = param[3].data.d_string;
-          data_length = strlen (palette_file) + 1;
+          if (palette_file)
+            data_length = strlen (palette_file) + 1;
+          else
+            data_length = 0;
         }
       else if (run_mode == GIMP_RUN_INTERACTIVE)
         {



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