From 1331989e7dcecfeb68097f13e9b62ad6bc49fbf8 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 19 Apr 2009 14:50:21 +0000 Subject: Fix palette endianness of 16bpp and higher BMPs. All BMP test suite images now display correctly on PowerPC (AmigaOS 4) except g04rle.bmp which is crashing in bmp_decode_rle() svn path=/trunk/libnsbmp/; revision=7135 --- src/libnsbmp.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/libnsbmp.c b/src/libnsbmp.c index 178422d..fead34e 100644 --- a/src/libnsbmp.c +++ b/src/libnsbmp.c @@ -731,6 +731,7 @@ static bmp_result bmp_decode_rgb24(bmp_image *bmp, uint8_t **start, int bytes) { if (bmp->opaque) scanline[x] |= (0xff << 24); data += skip; + scanline[x] = read_uint32((uint8_t *)&scanline[x],0); } } else { for (x = 0; x < bmp->width; x++) { @@ -740,6 +741,7 @@ static bmp_result bmp_decode_rgb24(bmp_image *bmp, uint8_t **start, int bytes) { if (bmp->opaque) scanline[x] |= (0xff << 24); data += skip; + scanline[x] = read_uint32((uint8_t *)&scanline[x],0); } } } @@ -808,6 +810,7 @@ static bmp_result bmp_decode_rgb16(bmp_image *bmp, uint8_t **start, int bytes) { scanline[x] |= (0xff << 24); } data += 2; + scanline[x] = read_uint32((uint8_t *)&scanline[x],0); } } else { for (x = 0; x < bmp->width; x++) { @@ -823,6 +826,7 @@ static bmp_result bmp_decode_rgb16(bmp_image *bmp, uint8_t **start, int bytes) { if (bmp->opaque) scanline[x] |= (0xff << 24); data += 2; + scanline[x] = read_uint32((uint8_t *)&scanline[x],0); } } } -- cgit v1.2.3