Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-03-11 13:26:29 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-03-11 13:26:29 +0300
commit527302bc0b0693b2f5d1ccb567fb532923cd393a (patch)
treeda01a2e5571b9df3e4513e427ac6c54cd7e262be
parentcf385caf926f06ce54131dac387be39c8665d680 (diff)
Fix 8bit BMP palette reading
part of D1173 by @rdb, load BGR -> RGB
-rw-r--r--source/blender/imbuf/intern/bmp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/imbuf/intern/bmp.c b/source/blender/imbuf/intern/bmp.c
index f8cf1164e4f..bc1ca47d090 100644
--- a/source/blender/imbuf/intern/bmp.c
+++ b/source/blender/imbuf/intern/bmp.c
@@ -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;