fix: Mark Bad or Invalid Images as Empty (#4151)

This commit is contained in:
nerix
2022-11-14 14:32:51 +01:00
committed by GitHub
parent 9fbdb936ab
commit 8031f33b53
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -479,12 +479,14 @@ void Image::actuallyLoad()
{
qCDebug(chatterinoImage)
<< "Error: image cant be read " << shared->url().string;
shared->empty_ = true;
return Failure;
}
const auto size = reader.size();
if (size.isEmpty())
{
shared->empty_ = true;
return Failure;
}
@@ -494,6 +496,7 @@ void Image::actuallyLoad()
qCDebug(chatterinoImage)
<< "Error: image has less than 1 frame "
<< shared->url().string << ": " << reader.errorString();
shared->empty_ = true;
return Failure;
}
@@ -504,6 +507,7 @@ void Image::actuallyLoad()
{
qCDebug(chatterinoImage) << "image too large in RAM";
shared->empty_ = true;
return Failure;
}