public
Last active

  • Download Gist
gistfile1.diff
Diff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Index: apps/plugins/imageviewer/png/png.c
===================================================================
--- apps/plugins/imageviewer/png/png.c (revision 25692)
+++ apps/plugins/imageviewer/png/png.c (working copy)
@@ -1129,7 +1129,9 @@
{
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)
{

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.