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.
This commit is contained in:
Jacob Boerema 2021-12-17 12:05:36 -05:00
parent e8a31ba4f2
commit 7b7d616358
1 changed files with 5 additions and 2 deletions

View File

@ -383,9 +383,12 @@ image_setup (GimpDrawable *drawable,
void
bumpmap_setup (GimpDrawable *bumpmap)
{
if (bumpmap && ! bump_buffer)
if (bumpmap)
{
bump_buffer = gimp_drawable_get_buffer (bumpmap);
if (! bump_buffer)
{
bump_buffer = gimp_drawable_get_buffer (bumpmap);
}
if (gimp_drawable_is_rgb (bumpmap))
bump_format = babl_format ("R'G'B' u8");