Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed Nov 16, 2018
1 parent 1503be5 commit 16c6b15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions coders/bmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -954,11 +954,11 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
bmp_info.bits_per_pixel<<=1;
bytes_per_line=4*((image->columns*bmp_info.bits_per_pixel+31)/32);
length=(size_t) bytes_per_line*image->rows;
if (((MagickSizeType) length/8) > GetBlobSize(image))
ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
if ((bmp_info.compression == BI_RGB) ||
(bmp_info.compression == BI_BITFIELDS))
{
if ((MagickSizeType) length > GetBlobSize(image))
ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
pixel_info=AcquireVirtualMemory(image->rows,
MagickMax(bytes_per_line,image->columns+256UL)*sizeof(*pixels));
if (pixel_info == (MemoryInfo *) NULL)
Expand Down

0 comments on commit 16c6b15

Please sign in to comment.