From: dirk Date: Sat, 21 Nov 2015 11:35:35 +0000 (+0100) Subject: Added missing check for destination transparency. X-Git-Tag: 7.0.1-0~477 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f0e5dc9d360bc60ac8c1b5e4fd60f27cc1b0e543;p=imagemagick Added missing check for destination transparency. --- diff --git a/MagickCore/pixel.c b/MagickCore/pixel.c index 3fb410848..91e62942a 100644 --- a/MagickCore/pixel.c +++ b/MagickCore/pixel.c @@ -6042,7 +6042,8 @@ MagickExport MagickBooleanType IsFuzzyEquivalencePixel(const Image *source, fuzz=GetFuzzyColorDistance(source,destination); scale=1.0; distance=0.0; - if (source->alpha_trait != UndefinedPixelTrait) + if (source->alpha_trait != UndefinedPixelTrait || + destination->alpha_trait != UndefinedPixelTrait) { /* Transparencies are involved - set alpha distance @@ -6055,8 +6056,10 @@ MagickExport MagickBooleanType IsFuzzyEquivalencePixel(const Image *source, Generate a alpha scaling factor to generate a 4D cone on colorspace Note that if one color is transparent, distance has no color component. */ - scale=QuantumScale*GetPixelAlpha(source,p); - scale*=QuantumScale*GetPixelAlpha(destination,q); + if (source->alpha_trait != UndefinedPixelTrait) + scale=QuantumScale*GetPixelAlpha(source,p); + if (destination->alpha_trait != UndefinedPixelTrait) + scale*=QuantumScale*GetPixelAlpha(destination,q); if (scale <= MagickEpsilon) return(MagickTrue); }