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
This commit is contained in:
Nils Wallménius 2010-04-25 08:35:30 +00:00
parent 8edca8e903
commit cbc65befa8
2 changed files with 5 additions and 1 deletions

View file

@ -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*/ 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_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) else if (decoder->infoPng.color.colorType == 0 || decoder->infoPng.color.colorType == 4)
{ {

View file

@ -537,6 +537,7 @@ Danny Attar
Philipp Stephani Philipp Stephani
Tore Johnny Bråtveit Tore Johnny Bråtveit
Marcin Bukat Marcin Bukat
Andrew Rodland
The libmad team The libmad team
The wavpack team The wavpack team