From cbc65befa8b3fbb53e7e2603f838a79b5fa5fcbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Wallm=C3=A9nius?= Date: Sun, 25 Apr 2010 08:35:30 +0000 Subject: [PATCH] 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 --- apps/plugins/imageviewer/png/png.c | 5 ++++- docs/CREDITS | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) 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