Fix 8bit BMP palette reading

part of D1173 by @rdb, load BGR -> RGB
This commit is contained in:
Campbell Barton
2015-03-11 21:26:29 +11:00
parent cf385caf92
commit 527302bc0b

View File

@@ -186,9 +186,10 @@ struct ImBuf *imb_bmp_decode(unsigned char *mem, size_t size, int flags, char co
}
for (j = x; j > 0; j--) {
const char *pcol = palette[bmp[0]];
rect[0] = pcol[0];
/* intentionally BGR -> RGB */
rect[0] = pcol[2];
rect[1] = pcol[1];
rect[2] = pcol[2];
rect[2] = pcol[0];
rect[3] = 255;
rect += 4; bmp += 1;