Commit 48294d3a authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fix crash when opening tiled TIFF with planar color data

TIFFTileSize() returns a the size of the tile for one color plane,
not for all the planes.

BUG:407171
parent ccd7785c
......@@ -631,10 +631,10 @@ KisImportExportErrorCode KisTIFFConverter::readTIFFDirectory(TIFF* image)
else {
ps_buf = new tdata_t[nbchannels];
uint32 * lineSizes = new uint32[nbchannels];
tmsize_t baseSize = TIFFTileSize(image) / nbchannels;
tmsize_t baseSize = TIFFTileSize(image);
for (uint i = 0; i < nbchannels; i++) {
ps_buf[i] = _TIFFmalloc(baseSize);
lineSizes[i] = tileWidth; // baseSize / lineSizeCoeffs[i];
lineSizes[i] = tileWidth;;
}
tiffstream = new KisBufferStreamSeperate((uint8**) ps_buf, nbchannels, depth, lineSizes);
delete [] lineSizes;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment