From 52260067e459900e9f0c4162854030785bd988d8 Mon Sep 17 00:00:00 2001 From: Mira Grudzinska Date: Tue, 9 May 2023 00:29:27 +0200 Subject: [PATCH] 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. --- src/lib/tvgPictureImpl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/tvgPictureImpl.h b/src/lib/tvgPictureImpl.h index b4d28e70..6af7a732 100644 --- a/src/lib/tvgPictureImpl.h +++ b/src/lib/tvgPictureImpl.h @@ -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;