diff --git a/src/modules/Image/layer_channel.h b/src/modules/Image/layer_channel.h index 75f6a008912aaff58ecbdfb889d974d46360268e..4c76ad86de8e8a11a594781fb847fbfcc4d372de 100644 --- a/src/modules/Image/layer_channel.h +++ b/src/modules/Image/layer_channel.h @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: layer_channel.h,v 1.9 2008/01/15 21:51:07 grubba Exp $ +|| $Id: layer_channel.h,v 1.10 2008/07/11 13:11:39 mast Exp $ */ /* template for operator layer row function */ @@ -11,12 +11,14 @@ static void LM_FUNC(rgb_group *s,rgb_group *l,rgb_group *d, rgb_group *sa,rgb_group *la,rgb_group *da, int len,double alpha) { - MEMCPY(da,sa,sizeof(rgb_group)*len); /* always copy alpha channel */ + if (da != sa) + MEMCPY(da,sa,sizeof(rgb_group)*len); /* always copy alpha channel */ #define da da da /* protect */ if (alpha==0.0) { #ifdef LAYER_DUAL - MEMCPY(d,s,sizeof(rgb_group)*len); + if (d != s) + MEMCPY(d,s,sizeof(rgb_group)*len); #endif return; }