[Gdal-dev] Null-Pointer in GDALOpen?

Mateusz Loskot mateusz at loskot.net
Mon Oct 22 11:00:28 EDT 2007


Tom Kazimiers wrote:
> Hello there,
> 
> by playing around with GDAL I got some times the following error:
> 
> Errorcode: 0xc0000005
> Erroradress: 0x011058a8
> Read: 0x00000000
> 
> Looks like Null-Pointer for me.
> 
> The code producing this is the following:
> 
> GDALDataset *poDataset = (GDALDataset *) GDALOpen("a.tif", GA_ReadOnly );
> 
> 
> The file "a.tif" exists and I have openend it several times until it
> suddenly stopped working.
> I tryed with a SVN build from today and got the same results.
> 
> What could cause such a failure in GDALOpen?

Tom,

First, you should always test pointer returned
from GDALOpen against null.

Have you tried to use full path to file?

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net



More information about the Gdal-dev mailing list