Ticket #2449 (closed defect: fixed)

Opened 2 months ago

Last modified 2 months ago

"TILED=YES" and "BLOCKYSIZE=1" make gdal_translate crash

Reported by: msieczka Assigned to: rouault
Priority: normal Milestone: 1.5.3
Component: GDAL_Raster Version: 1.5.2
Severity: major Keywords: gtiff tiled blockysize
Cc:

Description

gdal_translate crashes when requesting (bogus of course) "TILED=YES" and "BLOCKYSIZE=1" at the same time:

$ gdal_translate -co "TILED=YES" -co "BLOCKYSIZE=1" check.tif check_ts.tif Input file size is 205, 111 ERROR 1: TIFFReadDirectory:Cannot handle zero number of tiles 0ERROR 1: _TIFFVSetField:check_ts.tif: Bad value 1 for "TileLength?" tag ERROR 1: TIFFReadDirectory:Cannot handle zero number of tiles ERROR 1: TIFFReadDirectory:Cannot handle zero number of tiles Segmentation fault

Sample tiff attached. Backtrace below. Using GDAL 1.5.2 + SVN r14751.

shoofi@fooy:~$ gdb gdal_translate
GNU gdb 6.7.1-debian
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run -co "TILED=YES" -co "BLOCKYSIZE=1" check.tif check_ts.tif
Starting program: /usr/local/bin/gdal_translate -co "TILED=YES" -co "BLOCKYSIZE=1" check.tif check_ts.tif
[Thread debugging using libthread_db enabled]
warning: Lowest section in /usr/lib/libicudata.so.38 is .hash at 0000000000000120
[New Thread 0x2b47778cab30 (LWP 24623)]
Input file size is 205, 111
0ERROR 1: _TIFFVSetField:check_ts.tif: Bad value 1 for "TileLength" tag
ERROR 1: TIFFReadDirectory:Cannot handle zero number of tiles
ERROR 1: TIFFReadDirectory:Cannot handle zero number of tiles

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x2b47778cab30 (LWP 24623)]
GTiffCreateCopy (pszFilename=0x618560 "check_ts.tif", poSrcDS=0x619c00, 
    bStrict=<value optimized out>, papszOptions=0x618580, 
    pfnProgress=0x401f20 <GDALTermProgress@plt>, pProgressData=0x0)
    at geotiff.cpp:4609
4609	    hTIFF = (TIFF*) poDS->GetInternalHandle(NULL);
(gdb) bt
#0  GTiffCreateCopy (pszFilename=0x618560 "check_ts.tif", poSrcDS=0x619c00, 
    bStrict=<value optimized out>, papszOptions=0x618580, 
    pfnProgress=0x401f20 <GDALTermProgress@plt>, pProgressData=0x0)
    at geotiff.cpp:4609
#1  0x00002b4770d109cc in GDALDriver::CreateCopy (this=0x60e0f0, 
    pszFilename=0x618560 "check_ts.tif", poSrcDS=0x619c00, bStrict=0, 
    papszOptions=0x618580, pfnProgress=0x401f20 <GDALTermProgress@plt>, 
    pProgressData=0x0) at gdaldriver.cpp:529
#2  0x00000000004039bf in ProxyMain (argc=<value optimized out>, argv=0x618510)
    at gdal_translate.cpp:590
#3  0x00002b47751121c4 in __libc_start_main () from /lib/libc.so.6
#4  0x0000000000401f89 in _start ()

Attachments

check.tif (21.3 kB) - added by msieczka on 07/01/08 17:06:06.
sample tiff

Change History

07/01/08 17:06:06 changed by msieczka

  • attachment check.tif added.

sample tiff

07/02/08 13:51:26 changed by rouault

  • status changed from new to assigned.
  • owner changed from warmerdam to rouault.

07/02/08 13:58:09 changed by rouault

  • keywords set to gtiff tiled blockysize.
  • component changed from default to GDAL_Raster.
  • status changed from assigned to closed.
  • resolution set to fixed.

In fact, this was already fixed in trunk in r13743 before.

Fixed in branches/1.5 too in r14799