diff options
author | Nils Wallménius <nils@rockbox.org> | 2010-04-25 08:35:30 +0000 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2010-04-25 08:35:30 +0000 |
commit | cbc65befa8b3fbb53e7e2603f838a79b5fa5fcbc (patch) | |
tree | b312b498e2c94c0b4121b03e49cc93b4732fc11a | |
parent | 8edca8e9039e9c128912ee56802cbd505bf3cb23 (diff) | |
download | rockbox-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
-rw-r--r-- | apps/plugins/imageviewer/png/png.c | 5 | ||||
-rw-r--r-- | docs/CREDITS | 1 |
2 files changed, 5 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) { diff --git a/docs/CREDITS b/docs/CREDITS index 63563a45fc..9e4d86af78 100644 --- a/docs/CREDITS +++ b/docs/CREDITS @@ -537,6 +537,7 @@ Danny Attar Philipp Stephani Tore Johnny Bråtveit Marcin Bukat +Andrew Rodland The libmad team The wavpack team |