/*
Convert MIFF to BMP raster pixels.
*/
- pixel_info=AcquireVirtualMemory(image->rows,
- MagickMax(bytes_per_line,image->columns+256UL)*sizeof(*pixels));
+ pixel_info=AcquireVirtualMemory(image->rows,MagickMax(bytes_per_line,
+ image->columns+256UL)*sizeof(*pixels));
if (pixel_info == (MemoryInfo *) NULL)
ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
pixels=(unsigned char *) GetVirtualMemoryBlob(pixel_info);
UndefinedPixelTrait;
if ((dib_info.number_colors > 256) || (dib_info.colors_important > 256))
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
+ if ((dib_info.number_colors != 0) && (dib_info.bits_per_pixel > 8))
+ ThrowReaderException(CorruptImageError,"ImproperImageHeader");
if ((dib_info.image_size != 0U) && (dib_info.image_size > GetBlobSize(image)))
ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile");
- if ((dib_info.number_colors != 0) || (dib_info.bits_per_pixel < 16))
+ if ((dib_info.number_colors != 0) || (dib_info.bits_per_pixel < 8))
{
size_t
one;
p=comment_info->comment+strlen(comment_info->comment);
}
c=ReadBlobByte(image);
- if ((c != EOF) && (c != (int) '\n') && (c != (int) '\r'))
+ if (c != EOF)
{
*p=(char) c;
*(p+1)='\0';