[Gdal-dev] Re: Error2 CPLRealloc(): Out of memory allocating 10
bytes (with MrSID)
Daniele Romagnoli
dany.geotools at gmail.com
Thu Jul 5 07:03:57 EDT 2007
Hi List.
I'm again here ;)
Today I re-built GDAL with ECW support (for windows XP).
After spending some hours in the attempt of building it using a Visual
Studio .Net solution (Although I attempted to add all required Include,
Libs, and options, I encountered a lot of problems with NCS related files) I
finally used a simple NMAKE and I built it in 5 minutes.
Now, I'm fighting again with the old problem :) (related to MrSID support)
Thus, I'm really sorry bothering you with my old question:
Any suggestion to build GDAL using NMAKE without the error "CPLRealloc():
Out of memory allocating N bytes" occurring when reading some MrSID files
from Java?
^_^.
Best Regards
Daniele
On 6/28/07, Daniele Romagnoli <dany.geotools at gmail.com> wrote:
>
> 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
--
Best Regards,
Daniele Romagnoli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20070705/bc7bb098/attachment.html
More information about the Gdal-dev
mailing list