Opened 16 years ago

Closed 16 years ago

#2449 closed defect (fixed)

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

Reported by: msieczka Owned by: Even 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 (1)

check.tif (21.3 KB ) - added by msieczka 16 years ago.
sample tiff

Download all attachments as: .zip

Change History (3)

by msieczka, 16 years ago

Attachment: check.tif added

sample tiff

comment:1 by Even Rouault, 16 years ago

Owner: changed from warmerdam to Even Rouault
Status: newassigned

comment:2 by Even Rouault, 16 years ago

Component: defaultGDAL_Raster
Keywords: gtiff tiled blockysize added
Resolution: fixed
Status: assignedclosed

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

Fixed in branches/1.5 too in r14799

Note: See TracTickets for help on using tickets.