Le vendredi 27 mai 2011 18:46:29, Leith Bade a écrit : > Hi, > > I am trying to write an image that has a y inverted buffer. > > I tried this: > band->RasterIO(GF_Write, x, y, width, height, data + width * (height - 1) * > sizeof(short), > width, height, GDT_Int16, sizeof(short), -width * sizeof(short)); > > But I get a segfault in memcpy. > > What am I doing wrong?
First I assume that your data buffer is at least width * height * sizeof(short) large. Then if your data variable is of type char*, it should work. If it is of type short*, then data + width * (height - 1) * sizeof(short) is wrong. It should be data + width * (height - 1). > > Thanks, > Leith Bade > le...@leithalweapon.geek.nz _______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev