Skip to content

Commit

Permalink
https://github.com/ImageMagick/ImageMagick/issues/451
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Apr 26, 2017
1 parent f064939 commit fa72700
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions coders/bmp.c
Expand Up @@ -901,10 +901,17 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
packet_size=4;
offset=SeekBlob(image,start_position+14+bmp_info.size,SEEK_SET);
if (offset < 0)
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
{
bmp_colormap=(unsigned char *) RelinquishMagickMemory(bmp_colormap);
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
}
count=ReadBlob(image,packet_size*image->colors,bmp_colormap);
if (count != (ssize_t) (packet_size*image->colors))
ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
{
bmp_colormap=(unsigned char *) RelinquishMagickMemory(bmp_colormap);
ThrowReaderException(CorruptImageError,
"InsufficientImageDataInFile");
}
p=bmp_colormap;
for (i=0; i < (ssize_t) image->colors; i++)
{
Expand Down

0 comments on commit fa72700

Please sign in to comment.