X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=blobdiff_plain;f=src%2Fimage_load_tiff.c;h=07e6786b293285cba27d9eb52b69d382d1b65451;hp=3774f9dcc5fc770e66dc45b5d604771e336e30c1;hb=e8cd71d6f52967d7dd63efcb186834aa9e6e53e5;hpb=c6793b7a83cd1e3187661a2ffd7b949ee6dfa852 diff --git a/src/image_load_tiff.c b/src/image_load_tiff.c index 3774f9dc..07e6786b 100644 --- a/src/image_load_tiff.c +++ b/src/image_load_tiff.c @@ -295,18 +295,21 @@ static gboolean image_loader_tiff_load (gpointer loader, const guchar *buf, gsiz /* Turns out that the packing used by TIFFRGBAImage depends on * the host byte order... */ - while (pixels < lt->pixbuf->pixels + bytes) + { + guchar *ptr = pixels; + while (ptr < pixels + bytes) { - uint32 pixel = *(uint32 *)pixels; + uint32 pixel = *(uint32 *)ptr; int r = TIFFGetR(pixel); int g = TIFFGetG(pixel); int b = TIFFGetB(pixel); int a = TIFFGetA(pixel); - *pixels++ = r; - *pixels++ = g; - *pixels++ = b; - *pixels++ = a; + *ptr++ = r; + *ptr++ = g; + *ptr++ = b; + *ptr++ = a; } + } #endif lt->area_updated_cb(loader, 0, 0, width, height, lt->data);