# HG changeset patch # User Michal Čihař # Date 1345638031 -7200 # Node ID 48f2a488bee61417f81ee67dce532e1439a993a4 # Parent b141d52944ab2556063a2c2c2af2403c58f90b6d Do not access private GdkPixbuf data The GdkPixbuf is private to Gdk, so we can not access it, rather use numbers and data we anyway have. diff -r b141d52944ab -r 48f2a488bee6 src/image_load_tiff.c --- a/src/image_load_tiff.c Tue Aug 21 14:53:05 2012 +0200 +++ b/src/image_load_tiff.c Wed Aug 22 14:20:31 2012 +0200 @@ -148,6 +148,9 @@ static gboolean image_loader_tiff_load (gpointer loader, const guchar *buf, gsize count, GError **error) { ImageLoaderTiff *lt = (ImageLoaderTiff *) loader; +#if G_BYTE_ORDER == G_BIG_ENDIAN + int i; +#endif TIFF *tiff; guchar *pixels = NULL; @@ -326,17 +329,17 @@ /* Turns out that the packing used by TIFFRGBAImage depends on * the host byte order... */ - while (pixels < lt->pixbuf->pixels + bytes) + for (i = 0; i < bytes;) { - uint32 pixel = *(uint32 *)pixels; + uint32 pixel = *(uint32 *)(pixels + i); int r = TIFFGetR(pixel); int g = TIFFGetG(pixel); int b = TIFFGetB(pixel); int a = TIFFGetA(pixel); - *pixels++ = r; - *pixels++ = g; - *pixels++ = b; - *pixels++ = a; + pixels[i++] = r; + pixels[i++] = g; + pixels[i++] = b; + pixels[i++] = a; } #endif