From: Glenn Randers-P. <gl...@gm...> - 2006-08-22 19:01:59
|
On 8/22/06, Douglass Turner <dou...@gm...> wrote: > Thanks not actual true. Note the this line: > > > png_uint_16p pixel = (png_uint_16p)&(wpng_info.image_data[x > * 4 * (wpng_info.sample_depth/8)]); > > This assigns a pointer to a pixels red channel which is after the previous > pixel's alpha channel. > Thus there is no need to do the post-increment of the alpha channel pointer. > Actually if you did > post-increment you would run off the end of the scanline on the very last > pixel of the image resulting > in a segmentation fault. I don't think that would cause any harm. You can post-increment a pointer past the end of a buffer on the last iteration of a loop, and you won't get a segfault unless you go around the loop again. This doesn't seem to be a libpng question.... Glenn |