image viewer: png: do not show custom error message when there is not enough memory. get rid of use of iv->plug_buf.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29091 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Teruaki Kawashima 2011-01-19 13:20:00 +00:00
parent 622be891b3
commit 262e6db70e
3 changed files with 16 additions and 26 deletions

View file

@ -2189,5 +2189,8 @@ void LodePNG_Decoder_init(LodePNG_Decoder* decoder,
const char* LodePNG_perror(LodePNG_Decoder *decoder)
{
return png_error_messages[decoder->error-PNG_ERROR_MIN];
if (decoder->error >= PNG_ERROR_MIN && decoder->error <= PNG_ERROR_MAX)
return png_error_messages[decoder->error-PNG_ERROR_MIN];
else
return NULL;
}