On 8/23/2010 3:05 PM, Even Rouault wrote:
Le lundi 23 août 2010 05:28:17, Stephen Woodbridge a écrit :
Even,
It seems the adding:
#include<cpl_conv.h>
resolves the segv issue.
Strange, I think there's no particular good reason why it worked with GTiff and
not VRT. I assume you compile on a 64bit platform and that without header the
return type was assumed to be of integer type, thus leading to pointer
trucation.
Yes, good point, this was on a 64bit platform. and I did get a compiler
warning about incompatible types which was not obvious as to why from
reading the docs.
I suspect the the tiff worked because it was much smaller coverage than
the vrt file so the line buffer would have to have been significant
larger for the vrt file like causing the truncation, or something similar.
-Steve
I would recommend changing the example in:
http://www.gdal.org/gdal_tutorial.html
To include that in the section "Reading Raster Data" because the example
C code uses CPLMalloc(). It would also be very helpful to add:
...
CPLFree(pafScanline);
Done
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev