Improved the error message given when jpeg, TGA, and BMP images fail to decode.

This commit is contained in:
Alex Szpakowski
2016-02-28 12:41:27 -04:00
parent e08374fdd1
commit 8d7481c3b2
4 changed files with 9 additions and 7 deletions
+1 -4
View File
@@ -124,10 +124,7 @@ void ImageData::decode(love::filesystem::FileData *data)
// The decoder *must* output a 32 bits-per-pixel image.
if (decodedimage.size != decodedimage.width*decodedimage.height*sizeof(pixel))
{
if (decodeHandler)
decodeHandler->free(decodedimage.data);
else
delete[] decodedimage.data;
decoder->free(decodedimage.data);
throw love::Exception("Could not convert image!");
}