Merge pull request #38 from o-micron/patch-2

Fix LoadImageData return value when error occurs
This commit is contained in:
Syoyo Fujita 2018-02-10 16:53:00 +09:00 committed by GitHub
commit c7ae1a3e76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1176,7 +1176,7 @@ static bool LoadImageData(Image *image, std::string *err, int req_width,
if (err) {
(*err) += "Unknown image format.\n";
}
return true;
return false;
}
if (w < 1 || h < 1) {
@ -1184,7 +1184,7 @@ static bool LoadImageData(Image *image, std::string *err, int req_width,
if (err) {
(*err) += "Invalid image data.\n";
}
return true;
return false;
}
if (req_width > 0) {