[gimp] file-psd: use correct size for high bit depth extra channels



commit 6138b58f1441bc447283a4299b9a2aef446fa389
Author: Massimo Valentini <mvalentini src gnome org>
Date:   Fri Jun 19 18:58:39 2015 +0200

    file-psd: use correct size for high bit depth extra channels
    
    it was missing a '* bps' in the size of data passed to GEGL
    and the lower half of an extra-channel from a 16bit psd
    appeared as garbage in GIMP

 plug-ins/file-psd/psd-load.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/file-psd/psd-load.c b/plug-ins/file-psd/psd-load.c
index 1f7c29d..108b2d2 100644
--- a/plug-ins/file-psd/psd-load.c
+++ b/plug-ins/file-psd/psd-load.c
@@ -1854,8 +1854,8 @@ add_merged_image (gint32     image_id,
             }
 
           cidx = base_channels + i;
-          pixels = g_realloc (pixels, chn_a[cidx].columns * chn_a[cidx].rows);
-          memcpy (pixels, chn_a[cidx].data, chn_a[cidx].columns * chn_a[cidx].rows);
+          pixels = g_realloc (pixels, chn_a[cidx].columns * chn_a[cidx].rows * bps);
+          memcpy (pixels, chn_a[cidx].data, chn_a[cidx].columns * chn_a[cidx].rows * bps);
           channel_id = gimp_channel_new (image_id, alpha_name,
                                          chn_a[cidx].columns, chn_a[cidx].rows,
                                          alpha_opacity, &alpha_rgb);


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