[gimp/gimp-2-10] plug-ins: fix #5305 Lighting Effects crashes when I use a channel as Bumpmap



commit 468c067d6576f98e4b6c73adac04c9a8f509e844
Author: Jacob Boerema <jgboerema gmail com>
Date:   Fri Dec 17 12:05:36 2021 -0500

    plug-ins: fix #5305 Lighting Effects crashes when I use a channel as Bumpmap
    
    When a channel is selected as bumpmap, the bump_format can be different
    than it was before. However, we always kept the first bump_format, which
    could be RGB, in which case trying to use it with a channel caused a
    crash in GIMP.
    
    To fix this we always update the bump_format if bumpmap is enabled.
    
    (cherry picked from commit 7b7d61635891ef7f7d6aee6f8eec3e372c93b8c5)
    
    # Conflicts:
    #       plug-ins/lighting/lighting-image.c

 plug-ins/lighting/lighting-image.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/lighting/lighting-image.c b/plug-ins/lighting/lighting-image.c
index e74ff98b79..00d8abc595 100644
--- a/plug-ins/lighting/lighting-image.c
+++ b/plug-ins/lighting/lighting-image.c
@@ -383,9 +383,12 @@ image_setup (gint32 drawable_id,
 void
 bumpmap_setup (gint32 bumpmap_id)
 {
-  if (bumpmap_id != -1 && ! bump_buffer)
+  if (bumpmap_id != -1)
     {
-      bump_buffer = gimp_drawable_get_buffer (bumpmap_id);
+      if (! bump_buffer)
+        {
+          bump_buffer = gimp_drawable_get_buffer (bumpmap);
+        }
 
       if (gimp_drawable_is_rgb (bumpmap_id))
         bump_format = babl_format ("R'G'B' u8");


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