Changeset 14736

Show
Ignore:
Timestamp:
06/20/08 17:14:33 (5 months ago)
Author:
rouault
Message:

Fix crash in GDALCreateGeoLocTransformer if X_DATASET, etc... cannot be opened (#2434)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.5/gdal/alg/gdalgeoloc.cpp

    r12820 r14736  
    659659    } 
    660660 
     661    if (psTransform->hDS_X == NULL || 
     662        psTransform->hDS_Y == NULL) 
     663    { 
     664        GDALDestroyGeoLocTransformer( psTransform ); 
     665        return NULL; 
     666    } 
     667 
    661668/* -------------------------------------------------------------------- */ 
    662669/*      Get the band handles.                                           */ 
     
    669676    nBand = MAX(1,atoi(CSLFetchNameValue( papszGeolocationInfo, "Y_BAND" ))); 
    670677    psTransform->hBand_Y = GDALGetRasterBand( psTransform->hDS_Y, nBand ); 
     678 
     679    if (psTransform->hBand_X == NULL || 
     680        psTransform->hBand_Y == NULL) 
     681    { 
     682        GDALDestroyGeoLocTransformer( psTransform ); 
     683        return NULL; 
     684    } 
    671685 
    672686/* -------------------------------------------------------------------- */