Skip to content
Permalink
Browse files Browse the repository at this point in the history
XBM coder leaves the hex image data uninitialized if hex value of the…
… pixel is negative
  • Loading branch information
Cristy committed Jul 24, 2018
1 parent 31dd8a9 commit 216d117
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions coders/xbm.c
Expand Up @@ -351,7 +351,10 @@ static Image *ReadXBMImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
c=XBMInteger(image,hex_digits);
if (c < 0)
break;
{
data=(unsigned char *) RelinquishMagickMemory(data);
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
}
*p++=(unsigned char) c;
if ((padding == 0) || (((i+2) % bytes_per_line) != 0))
*p++=(unsigned char) (c >> 8);
Expand All @@ -361,7 +364,10 @@ static Image *ReadXBMImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
c=XBMInteger(image,hex_digits);
if (c < 0)
break;
{
data=(unsigned char *) RelinquishMagickMemory(data);
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
}
*p++=(unsigned char) c;
}
if (EOFBlob(image) != MagickFalse)
Expand Down

2 comments on commit 216d117

@bastien-roucaries
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have the im6 commit ?

@dlemstra
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.