Re: [gdal-dev] OGRFree(pszSrcWKT) can crash Matlab

2010-01-23 Thread jluis
Quoting Chaitanya kumar CH : Joaquim, You did change pszSrcWkt ( http://code.google.com/p/mirone/source/browse/trunk/mex/gdalwarp_mex.cpp#385 ). You should remove line 385 and move the line 386 to 330. Ok, thank you guys. Joaquim On Sat, Jan 23, 2010 at 11:17 PM, wrote: Quoting Even

Re: [gdal-dev] OGRFree(pszSrcWKT) can crash Matlab

2010-01-23 Thread Chaitanya kumar CH
Joaquim, You did change pszSrcWkt ( http://code.google.com/p/mirone/source/browse/trunk/mex/gdalwarp_mex.cpp#385 ). You should remove line 385 and move the line 386 to 330. On Sat, Jan 23, 2010 at 11:17 PM, wrote: > Quoting Even Rouault : > > Joaquim, >> >> you don't provide enough code to re

Re: [gdal-dev] OGRFree(pszSrcWKT) can crash Matlab

2010-01-23 Thread jluis
Quoting Even Rouault : Joaquim, you don't provide enough code to really see what's wrong, but my guess is that you misuse GDAL API. Even Quite possible the first and I was trying to summarize what happens If you get pszSrcWKT, with pszSrcWKT = GDALGetProjectionRef(hDS); No, I got i

Re: [gdal-dev] OGRFree(pszSrcWKT) can crash Matlab

2010-01-23 Thread Even Rouault
Joaquim, you don't provide enough code to really see what's wrong, but my guess is that you misuse GDAL API. If you get pszSrcWKT, with pszSrcWKT = GDALGetProjectionRef(hDS); The pszSrcWKT string is owned by the hDS object, so as soon as you destroy the hDS object with GDALClose(), the pointe

Re: [gdal-dev] OGRFree(pszSrcWKT) can crash Matlab

2010-01-23 Thread Chaitanya kumar CH
Joaquim, I understand that printing the contents of pszSrcWKT gave different results before and after the call to GDALClose( hSrcDS ). There seems to be some code you left in the mail. Can you paste the neighbouring code at http://pastebin.ca ? On Sat, Jan 23, 2010 at 8:34 PM, wrote: > Hi, > >

[gdal-dev] OGRFree(pszSrcWKT) can crash Matlab

2010-01-23 Thread jluis
Hi, I have a serious crash in one of my Matlab MEXs caused by a call to OGRFree() with an argument of size one (possibly the null terminator). This happens on OSX SL (64 bits) but not on Windows (where I still build at 32 bits) Here is, as far as I could trace it, what is happening (SVN ve