[gimp/wip/wormnest/psp-mask: 3/4] plug-ins: don't request buffer before we need it in file-psp.




commit 5a89262e37ee1a75bc64c7ff2b32e999969022fc
Author: Jacob Boerema <jgboerema gmail com>
Date:   Sat Oct 3 15:32:41 2020 -0400

    plug-ins: don't request buffer before we need it in file-psp.

 plug-ins/common/file-psp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/plug-ins/common/file-psp.c b/plug-ins/common/file-psp.c
index f1237f22b3..9c90c1d414 100644
--- a/plug-ins/common/file-psp.c
+++ b/plug-ins/common/file-psp.c
@@ -2286,8 +2286,6 @@ read_layer_block (FILE      *f,
                 pixels[i] = pixel + width * bytespp * i;
             }
 
-          buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (layer));
-
           /* Read the layer channel sub-blocks */
           while (ftell (f) < sub_block_start + sub_total_len)
             {
@@ -2391,9 +2389,9 @@ read_layer_block (FILE      *f,
                 }
             }
 
+          buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (layer));
           gegl_buffer_set (buffer, GEGL_RECTANGLE (0, 0, width, height), 0,
                           NULL, pixel, GEGL_AUTO_ROWSTRIDE);
-
           g_object_unref (buffer);
 
           g_free (pixels);


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