From: Cristy Date: Thu, 27 Jun 2019 13:06:08 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.8-51~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a3946cbc7ebf1fc51532bc6f83e2c2258aff73a;p=imagemagick ... --- diff --git a/MagickCore/composite.c b/MagickCore/composite.c index 78d6dff92..203e7ab9f 100644 --- a/MagickCore/composite.c +++ b/MagickCore/composite.c @@ -654,18 +654,19 @@ MagickExport MagickBooleanType CompositeImage(Image *image, q+=GetPixelChannels(image); continue; } - for (i=0; i < (ssize_t) GetPixelChannels(image); i++) + for (i=0; i < (ssize_t) GetPixelChannels(source_image); i++) { - PixelChannel channel = GetPixelChannelChannel(image,i); - PixelTrait traits = GetPixelChannelTraits(image,channel); - PixelTrait source_traits=GetPixelChannelTraits(source_image, + PixelChannel channel = GetPixelChannelChannel(source_image,i); + PixelTrait source_traits = GetPixelChannelTraits(source_image, channel); + PixelTrait traits = GetPixelChannelTraits(image,channel); if (traits == UndefinedPixelTrait) continue; if (source_traits != UndefinedPixelTrait) SetPixelChannel(image,channel,p[i],q); - else if (channel == AlphaPixelChannel) - SetPixelChannel(image,channel,OpaqueAlpha,q); + else + if (channel == AlphaPixelChannel) + SetPixelChannel(image,channel,OpaqueAlpha,q); } p+=GetPixelChannels(source_image); q+=GetPixelChannels(image);