common: changed a returned value from load function

In the event that malloc returns a nullptr while copying
loaded raw data, a Result::NonSupport value is returned.
However, it appears that Result::FailedAllocation would be
more accurate.
This commit is contained in:
Mira Grudzinska 2023-05-09 00:29:27 +02:00 committed by Hermet Park
parent 85f001c88d
commit 52260067e4

View file

@ -245,7 +245,7 @@ struct Picture::Impl
if (paint || surface) return Result::InsufficientCondition;
if (loader) loader->close();
loader = LoaderMgr::loader(data, w, h, copy);
if (!loader) return Result::NonSupport;
if (!loader) return Result::FailedAllocation;
this->w = loader->w;
this->h = loader->h;
return Result::Success;