[Gdal-dev] Error2 CPLRealloc(): Out of memory allocating 10 bytes (with MrSID)

Daniele Romagnoli dany.geotools at gmail.com
Thu Jun 28 11:54:43 EDT 2007


Hi list,
I encountered a strange error when using GDAL's MrSID driver from Java.
(My system is Windows XP with Visual Studio .Net 2003)

I built GDAL from SVN (I'm using the revision 11339) using NMAKE.

I written an ImageIO plugin for loading and reading MrSID data sources.
This is a typical code in my plugin:
-------------------------------------------------------------------------------------------
...
{
       Dataset ds = gdal.Open(String name, int accessType);
       ...
       // trivial operations (getting Driver and Driver's description).
       ...
       ds.delete();
}
...
// trivial operations
...
{
 ...
 Dataset ds = gdal.Open(String name, int accessType);
 ...
}
-------------------------------------------------------------------------------------------------------------------------------------------------------------
I noticed that on some MrSID data samples, when calling the Open method the
second time, this error will occur:
Error2 CPLRealloc(): Out of memory allocating 10 bytes.

It is thrown when MrSID parses metadata on mrsiddataset.cpp:
pszMetadata = (char *)CPLRealloc( pszMetadata, iLength );

To solve this problem, I built GDAL using a Visual Studio Solution (with
MrSID support properly configured) and the error magically disappears.

Any suggestion to build GDAL using NMAKE without this error?
(I already attempted a NMAKE clean ...)

Thank you very much.

-- 
Best Regards,
Daniele Romagnoli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20070628/a4ffa40e/attachment.html


More information about the Gdal-dev mailing list