mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 20:14:37 +00:00
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:
parent
85f001c88d
commit
52260067e4
1 changed files with 1 additions and 1 deletions
|
@ -245,7 +245,7 @@ struct Picture::Impl
|
||||||
if (paint || surface) return Result::InsufficientCondition;
|
if (paint || surface) return Result::InsufficientCondition;
|
||||||
if (loader) loader->close();
|
if (loader) loader->close();
|
||||||
loader = LoaderMgr::loader(data, w, h, copy);
|
loader = LoaderMgr::loader(data, w, h, copy);
|
||||||
if (!loader) return Result::NonSupport;
|
if (!loader) return Result::FailedAllocation;
|
||||||
this->w = loader->w;
|
this->w = loader->w;
|
||||||
this->h = loader->h;
|
this->h = loader->h;
|
||||||
return Result::Success;
|
return Result::Success;
|
||||||
|
|
Loading…
Add table
Reference in a new issue