diff --git a/MagickCore/channel.c b/MagickCore/channel.c
index ff27d14..8623ef6 100644
--- a/MagickCore/channel.c
+++ b/MagickCore/channel.c
@@ -345,7 +345,7 @@
return(destination_image);
}
destination_channel=(PixelChannel) i;
- channel_mask|=ParseChannelOption(token);
+ channel_mask=(ChannelType) (channel_mask | ParseChannelOption(token));
if (LocaleCompare(token,"gray") == 0)
(void) SetImageColorspace(destination_image,GRAYColorspace,exception);
if ((LocaleCompare(token,"black") == 0) ||
@@ -395,8 +395,8 @@
{
case ExtractChannelOp:
{
- channel_mask|=(1 << destination_channel);
- destination_channel++;
+ channel_mask=(ChannelType) (channel_mask | (1 << destination_channel));
+ destination_channel=(PixelChannel) (destination_channel+1);
break;
}
default: