From f6436eee96eacde532d5cfd20e1e65685e69927e Mon Sep 17 00:00:00 2001 From: Ell Date: Thu, 19 Jan 2017 13:51:48 -0500 Subject: [PATCH] app: in gimp_composite_blend(), avoid overwriting input in some cases Note that in some cases the alloca may be unnecessary, but this keeps the code clean, and we have to be able to *potentially* do the alloca anyway, so what the hell. --- app/operations/layer-modes/gimpblendcomposite.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/operations/layer-modes/gimpblendcomposite.h b/app/operations/layer-modes/gimpblendcomposite.h index f5094209b5..ddcb232ac7 100644 --- a/app/operations/layer-modes/gimpblendcomposite.h +++ b/app/operations/layer-modes/gimpblendcomposite.h @@ -290,10 +290,14 @@ gimp_composite_blend (gfloat *in, read it for the compositing stage */ blend_out = g_alloca (sizeof (gfloat) * 4 * samples); - if (fish_to_blend) + if (fish_to_blend || fish_to_composite) { blend_in = g_alloca (sizeof (gfloat) * 4 * samples); blend_layer = g_alloca (sizeof (gfloat) * 4 * samples); + } + + if (fish_to_blend) + { babl_process (fish_to_blend, in, blend_in, samples); babl_process (fish_to_blend, layer, blend_layer, samples); }