Changeset 14799

Show
Ignore:
Timestamp:
07/02/08 13:57:07 (5 months ago)
Author:
rouault
Message:

Fix crash with gdal_translate -co "TILED=YES" -co "BLOCKYSIZE=1" (#2449)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.5/gdal/frmts/gtiff/geotiff.cpp

    r14797 r14799  
    46214621        poDS = (GTiffDataset *) GDALOpen( pszFilename, GA_ReadOnly ); 
    46224622 
    4623     if( poDS != NULL && EQUAL(pszProfile,"GDALGeoTIFF") ) 
     4623    if ( poDS == NULL ) 
     4624    { 
     4625        VSIUnlink( pszFilename ); 
     4626        return NULL; 
     4627    } 
     4628 
     4629    if( EQUAL(pszProfile,"GDALGeoTIFF") ) 
    46244630    { 
    46254631        poDS->CloneInfo( poSrcDS, GCIF_PAM_DEFAULT ); 
     
    46524658/*      Copy actual imagery.                                            */ 
    46534659/* -------------------------------------------------------------------- */ 
    4654     if( poDS != NULL ) 
    4655     { 
    4656         eErr = GDALDatasetCopyWholeRaster( (GDALDatasetH) poSrcDS,  
    4657                                            (GDALDatasetH) poDS, 
    4658                                            NULL, pfnProgress, pProgressData ); 
    4659  
    4660         if( eErr == CE_Failure ) 
    4661         { 
    4662             delete poDS; 
    4663             poDS = NULL; 
    4664              
    4665             VSIUnlink( pszFilename ); // should really delete more carefully. 
    4666         } 
     4660    eErr = GDALDatasetCopyWholeRaster( (GDALDatasetH) poSrcDS,  
     4661                                        (GDALDatasetH) poDS, 
     4662                                        NULL, pfnProgress, pProgressData ); 
     4663 
     4664    if( eErr == CE_Failure ) 
     4665    { 
     4666        delete poDS; 
     4667        poDS = NULL; 
     4668         
     4669        VSIUnlink( pszFilename ); // should really delete more carefully. 
    46674670    } 
    46684671