summaryrefslogtreecommitdiffstats
path: root/apps/plugins/imageviewer/png
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2010-04-25 08:35:30 +0000
committerNils Wallménius <nils@rockbox.org>2010-04-25 08:35:30 +0000
commitcbc65befa8b3fbb53e7e2603f838a79b5fa5fcbc (patch)
treeb312b498e2c94c0b4121b03e49cc93b4732fc11a /apps/plugins/imageviewer/png
parent8edca8e9039e9c128912ee56802cbd505bf3cb23 (diff)
downloadrockbox-cbc65befa8b3fbb53e7e2603f838a79b5fa5fcbc.tar.gz
rockbox-cbc65befa8b3fbb53e7e2603f838a79b5fa5fcbc.zip
Fix for some bogus code in png by Andrew Rodland, fixing a warning when compiling with gcc 4.5
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25709 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/imageviewer/png')
-rw-r--r--apps/plugins/imageviewer/png/png.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/plugins/imageviewer/png/png.c b/apps/plugins/imageviewer/png/png.c
index 4a7e0963d9..310b08d990 100644
--- a/apps/plugins/imageviewer/png/png.c
+++ b/apps/plugins/imageviewer/png/png.c
@@ -1129,7 +1129,10 @@ static void decodeGeneric(LodePNG_Decoder* decoder, unsigned char* in, size_t si
{
if (chunkLength != 1) { decoder->error = 43; break; } /*error: this chunk must be 1 byte for indexed color image*/
decoder->infoPng.background_defined = 1;
- decoder->infoPng.background_r = decoder->infoPng.background_g = decoder->infoPng.background_g = data[0];
+ decoder->infoPng.background_r = decoder->infoPng.color.palette[4 * data[0] + 0];
+ decoder->infoPng.background_g = decoder->infoPng.color.palette[4 * data[0] + 1];
+ decoder->infoPng.background_b = decoder->infoPng.color.palette[4 * data[0] + 2];
+
}
else if (decoder->infoPng.color.colorType == 0 || decoder->infoPng.color.colorType == 4)
{