Changeset 14713

Show
Ignore:
Timestamp:
06/16/08 18:16:03 (6 months ago)
Author:
rouault
Message:

Test if GDAL MEM driver is available

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gdal/alg/gdalcutline.cpp

    r14712 r14713  
    203203    float *pafMask = (float *) pValidityMask; 
    204204    CPLErr eErr; 
     205    GDALDriverH hMemDriver; 
    205206 
    206207/* -------------------------------------------------------------------- */ 
     
    216217    { 
    217218        CPLAssert( FALSE ); 
     219        return CE_Failure; 
     220    } 
     221 
     222    hMemDriver = GDALGetDriverByName("MEM"); 
     223    if (hMemDriver == NULL) 
     224    { 
     225        CPLError(CE_Failure, CPLE_AppDefined, "GDALWarpCutlineMasker needs MEM driver"); 
    218226        return CE_Failure; 
    219227    } 
     
    262270    apszOptions[0] = (char *) osDPOption.c_str(); 
    263271 
    264     hMemDS = GDALCreate( GDALGetDriverByName("MEM"), "warp_temp",  
     272    hMemDS = GDALCreate( hMemDriver, "warp_temp",  
    265273                         nXSize, nYSize, 0, GDT_Byte, NULL ); 
    266274    GDALAddBand( hMemDS, GDT_Byte, apszOptions );