[gimp] plug-ins: tiff-load initialize a variable before using it



commit cdfca0b420b994a1d328ac809a5524ed9feba0c4
Author: Øyvind Kolås <pippin gimp org>
Date:   Tue Jun 11 23:48:26 2019 +0200

    plug-ins: tiff-load initialize a variable before using it
    
    Initialize channel[0].buffer before using it, as a response to the following
    critical warning reported in issue #3264 about it being NULL:
    
    (file-tiff:1074): GEGL-CRITICAL **: 17:10:57.175: gegl_buffer_get_format: assertion 'buffer' failed

 plug-ins/file-tiff/file-tiff-load.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/plug-ins/file-tiff/file-tiff-load.c b/plug-ins/file-tiff/file-tiff-load.c
index 32445162bb..29fe73d4c3 100644
--- a/plug-ins/file-tiff/file-tiff-load.c
+++ b/plug-ins/file-tiff/file-tiff-load.c
@@ -973,6 +973,8 @@ load_image (GFile              *file,
           g_free (name);
         }
 
+      channel[0].buffer = gimp_drawable_get_buffer (layer);
+
       if (! base_format && image_type == GIMP_INDEXED)
         {
           /* can't create the palette format here, need to get it from
@@ -988,7 +990,6 @@ load_image (GFile              *file,
         }
 
       channel[0].ID     = layer;
-      channel[0].buffer = gimp_drawable_get_buffer (layer);
       channel[0].format = base_format;
 
       if (extra > 0 && ! worst_case)


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