Data narrower than 32bpp is padded to an unsigned long and on
big-endian systems this shifts the value by the padding bits.
#include <stdio.h>
#include <stdlib.h> /* abort() */
#include <math.h>
+#include <config.h>
#define FALSE 0
#define TRUE !FALSE
unsigned long val;
val = *(unsigned long *) pixman_image_get_data (image);
+#ifdef WORDS_BIGENDIAN
+ val >>= 8 * sizeof(val) - PIXMAN_FORMAT_BPP (format);
+#endif
/* Number of bits in each channel */
a = PIXMAN_FORMAT_A (format);