summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/plugins/imageviewer/png/png.c5
-rw-r--r--docs/CREDITS1
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