Page 1 of 1

Re: Bug? ImageMagick 6.3.4.9 vs a large BMP

Posted: 2007-06-16T10:38:30-07:00
by el_supremo
The bmp.c coder is reading the image's width and height as long integers but then casting them as (short) which will truncate 70000 to 4464.
In bmp.c at line 639, this code:

Code: Select all

        /*
          Microsoft Windows BMP image file.
        */
        if (bmp_info.size < 40)
          ThrowReaderException(CorruptImageError,"NonOS2HeaderSizeError");
        bmp_info.width=(short) ReadBlobLSBLong(image);
        bmp_info.height=(short) ReadBlobLSBLong(image);
should be changed to this:

Code: Select all

        /*
          Microsoft Windows BMP image file.
        */
        if (bmp_info.size < 40)
          ThrowReaderException(CorruptImageError,"NonOS2HeaderSizeError");
        bmp_info.width= ReadBlobLSBLong(image);
        bmp_info.height= ReadBlobLSBLong(image);
I can't test it right now but that should fix it.
Pete