rgba codec mishandles images without alpha channel

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
eevee
Posts: 2
Joined: 2012-04-05T23:07:12-07:00
Authentication code: 8675308

rgba codec mishandles images without alpha channel

Post by eevee »

http://trac.imagemagick.org/browser/Ima ... gb.c#L1111

Code: Select all

  if (LocaleCompare(image_info->magick,"RGBA") == 0)
    {
      quantum_type=RGBAQuantum;
      image->matte=MagickTrue;
    }
  // ...
  do
  {
    if ((LocaleCompare(image_info->magick,"RGBA") == 0) &&
        (image->matte == MagickFalse))
      (void) SetImageAlphaChannel(image,ResetAlphaChannel);
This second `if` will never fire, because `image->matte` is set to true above without initializing the alpha channel. The result is an rgba file with seeming garbage in the alpha channel.

This appears to have been fixed in 7, but it still affects 6.7.6.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: rgba codec mishandles images without alpha channel

Post by magick »

Thanks for the bug report. We will have a patch to fix it within a day or two.
Post Reply