Permalink
Browse files

XBM coder leaves the hex image data uninitialized if hex value of the…

… pixel is negative
  • Loading branch information...
Cristy
Cristy committed Jul 24, 2018
1 parent 31dd8a9 commit 216d117f05bff87b9dc4db55a1b1fadb38bcb786
Showing with 8 additions and 2 deletions.
  1. +8 −2 coders/xbm.c
@@ -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);
@@ -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)

2 comments on commit 216d117

@bastien-roucaries

This comment has been minimized.

bastien-roucaries replied Oct 29, 2018

Can we have the im6 commit ?

@dlemstra

This comment has been minimized.

Member

dlemstra replied Oct 29, 2018

Please sign in to comment.