2018.04.23 16:00 "[Tiff] libTiff Bug", by SM

2018.04.23 16:00 "[Tiff] libTiff Bug", by SM

 Hi libTiff community,

libTiff library crashes for a particular large chunky tiled YCbCr image when using the RGBA interface.

I tried this with your latest libTiff version (4.0.9) and earlier versions as well.

#include <tiffio.h>

int main()
    TIFF *tif=TIFFOpen("Test_001.tif", "r");
    uint32 width;
    uint32 height;
    TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &width);
    TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &height);

    uint32 npixels=width*height;

    uint32* raster=(uint32 *) _TIFFmalloc(npixels *sizeof(uint32));
    TIFFReadRGBAImage(tif, width, height, raster, 0);


Stack trace

Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7b8920b in?? () from /usr/lib/x86_64-linux-gnu/libtiff.so.5 (gdb) bt

#0 0x00007ffff7b8920b in?? () from /usr/lib/x86_64-linux-gnu/libtiff.so.5 #1 0x00007ffff7b8eb77 in?? () from /usr/lib/x86_64-linux-gnu/libtiff.so.5 #2 0x00007ffff7b91405 in TIFFReadRGBAImageOriented () from /usr/lib/ x86_64-linux-gnu/libtiff.so.5

#3 0x00000000004007e0 in main () at main.c:12 <http://p4dbmaster.mathworks.com/cgi-bin/changeView.cgi?CH=12>

Please let me know if this can be fixed and in which release it will be fixed?