[gdal-dev] A nodatavalue crashing problem with MEXs

Joaquim Luis jluis at ualg.pt
Sun Apr 6 12:57:14 EDT 2008


Hi,

I have MEXified (a Matlab wrap) a kind of gdal_warp using virtual 
datasets. It seams to be working more or less fine (some of problems are 
due to the gdal warping itself as mentioned in ticket #2305) but I'm 
having a serious problem when trying to set a nodatavalue. Having the 
following code active simply crash the Matlab session.

        double nan = 0;
        psWarpOptions->padfDstNoDataReal = (double 
*)CPLMalloc(nBands*sizeof(double));
        for (i = 0; i < nBands; i++) {
            psWarpOptions->padfDstNoDataReal[i] = nan;
            GDALSetRasterNoDataValue( GDALGetRasterBand(hDstDS, i+1),
                        psWarpOptions->padfDstNoDataReal[i] );
        }

Am I doing something obviously idiot?

Thanks
Joaquim Luis


More information about the gdal-dev mailing list