Images are allocated without being initialized, so a reader must write
every pixel of every line. The IFF reader did not always:
- Maya: nothing checked that the tiles cover the image: areas no tile
covers are now opaque black.
- readStandardImage(), readCDIImage(), readRGFXImage() and
readDEEPImage() copied min(bytesPerLine, decoded line) bytes, and some
decoded lines are shorter than the image line:
- a PBM with 8 bitplanes and a 64 color CMAP was taken for HAM and
allocated as RGB888, while PBM data are one index per pixel: HAM is
no longer applied to PBM images;
- other mismatches (e.g. HAM without CMAP, RGB8 with 32 bitplanes, CD-i
CLUT3 or RGB888, a truncated CD-i line) are now an error: a decoded
line that does not cover the image line is refused.
Added the read test pbm_64colors.iff, which fails without this change.
Images are allocated without being initialized, so a reader must write
every pixel of every line. The PCX reader did not always:
- readImage2() and readImage4v2() decoded width / 4 and width / 2 bytes,
so the last pixels of lines whose width is not a multiple of 4 (2 bits)
or 2 (4 bits) were not set. They now decode every pixel.
- With a BytesPerLine smaller than a line of pixels, readImage1(),
readImage8() and readImage24() left the end of each line unset: such
headers are now refused by isSupported(), which replaces the check
readImage4() had.
Added the read tests indexed2_w13.pcx and indexed4_w13.pcx, which fail
without this change.
1-bit images with a color map are loaded as Indexed8, but their lines
were copied packed: the first (width + 7) / 8 bytes (rounded up to an
even number) of each line held packed bits read as indexes, and the rest
of the line was not set, so it kept whatever the memory held (images are
allocated without being initialized). The bits are now unpacked to one
index per pixel.
Added the read test pal1bit.ras, which fails without this change.