Opened 14 years ago

Closed 14 years ago

#3512 closed defect (fixed)

Can't read this tiff image

Reported by: gaopeng Owned by: warmerdam
Priority: normal Milestone: 1.8.0
Component: GDAL_Raster Version: 1.6.1
Severity: normal Keywords: gtiff
Cc:

Description

The test image is at ftp://GDAL@ftp.esri.com/1-2.tif. It's tiff with LZW compression.

I got lots of error messages as the following when displaying the test image.

ERROR 1: TIFFReadBufferSetup:No space for data buffer at scanline 4294967295
ERROR 1: TIFFReadScanline() failed.
ERROR 1: IReadBlock failed at X offset 0, Y offset 7890

Here is the output from gdalinfo:

C:\Program Files\FWTools2.2.8>gdalinfo "C:\Temp\ESRITest\1-2.tif"
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" contains nu
ll byte in value; value incorrectly truncated during reading due to implementati
on limitations
Driver: GTiff/GeoTIFF
Files: C:\Temp\ESRITest\1-2.tif
Size is 8448, 10411
Coordinate System is `'
Metadata:
  TIFFTAG_IMAGEDESCRIPTION=
  TIFFTAG_XRESOLUTION=300
  TIFFTAG_YRESOLUTION=300
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,10411.0)
Upper Right ( 8448.0,    0.0)
Lower Right ( 8448.0,10411.0)
Center      ( 4224.0, 5205.5)
Band 1 Block=8448x10411 Type=Byte, ColorInterp=Red
Band 2 Block=8448x10411 Type=Byte, ColorInterp=Green
Band 3 Block=8448x10411 Type=Byte, ColorInterp=Blue

Change History (3)

comment:1 by warmerdam, 14 years ago

Keywords: gtiff added
Status: newassigned

I have reproduced this bug on a 32bit linux server, yet it works on my 64 bit development linux system. It would appear to be something that has been corrected in libtiff, but I am tracking down the details and will retrofit a fixed libtiff into 1.6-esri once I have worked it all out.

comment:2 by warmerdam, 14 years ago

The bug is specific to 32bit systems, and is caused by sp->dec_bitsleft overflowing the size of an integer for buffers larger than 228 bytes (256MB). This particular file has a single LZW compressed strip of 288MB or so. The bug is in libtiff. I will prepare a fix...

comment:3 by warmerdam, 14 years ago

Milestone: 1.8.0
Resolution: fixed
Status: assignedclosed

This has been fixed in libtiff upstream, and trunk updated with the latest libtiff (r19257). A minimal fix for just this issue has been incorporated into 1.6-esri (r19259).

Note: See TracTickets for help on using tickets.