[Gdal-dev] Problem with external tiff/geotiff.

Frédéric Trastour support at geoimage.fr
Wed Mar 17 12:18:38 EST 2004


Hello,

I use GDAL on Win32.
GDAL is configured to use external Tiff and GEOtiff libraries ( V3.6.0 and V1.2.1 ).

Everything works fine execpting that  I have a crash in  gt_wkt_srs.cpp.

the problem is the following :

------------------------------------------------------------------------------------------------------
    in char *GTIFGetOGISDefn( GTIFDefn * psDefn )

    ...

    if( psDefn->SemiMajor == 0.0 )
    {
        pszSpheroidName = CPLStrdup("unretrievable - using WGS84");
        dfSemiMajor = SRS_WGS84_SEMIMAJOR;
        dfInvFlattening = SRS_WGS84_INVFLATTENING;
    }
    ...

    GTIFFreeMemory( pszPMName );
    GTIFFreeMemory( pszSpheroidName );
    GTIFFreeMemory( pszAngularUnits );

------------------------------------------------------------------------------------------------------

pszSpheroidName is allocated with CPLStrdup ( based on VSIStrdup based on strdup )
then liberated using  GTIFFreeMemory based on the libTIFF allocator which use on windows,
functions like GlobalAlloc, GlobalFree... (in tif_win32.c).

It looks like strdup isn't based on the same allocator.
I can replace the GTIFFreeMemory( pszSpheroidName ) call manually but perhaps there are other
similar problems in Gtiff stuff, and it is not very easy to check everything.

What is your opinion about that ?

Are there other users with the same config (external tiff and geotiff on win32) with the
same problems ?

Thanks in advance,
Frédéric.

_______________________________________________________________
Frédéric Trastour - SpacEyes - dev at spaceyes.fr





More information about the Gdal-dev mailing list