From cdc6b3cdd9c66fda77d4d72504cab4b69ab3afae Mon Sep 17 00:00:00 2001 From: m30063213 Date: Thu, 24 Jul 2025 11:30:17 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=A8=B3=E5=AE=9A=E6=80=A7=E9=97=AE?= =?UTF-8?q?=E9=A2=98+2=20Signed-off-by:=20maqianli=20<15735184237@163.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frameworks/native/capi/image_effect_filter.cpp | 1 + frameworks/native/efilter/base/efilter.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/frameworks/native/capi/image_effect_filter.cpp b/frameworks/native/capi/image_effect_filter.cpp index baa45e8..40826ec 100644 --- a/frameworks/native/capi/image_effect_filter.cpp +++ b/frameworks/native/capi/image_effect_filter.cpp @@ -39,6 +39,7 @@ static std::vector> sOHFilterNames; void OH_EffectFilter::SetParameter(const std::string &key, Plugin::Any ¶m) { + CHECK_AND_RETURN_LOG(params_ != nullptr, "SetParameter: params_ is null!"); params_.erase(key); params_.emplace(key, param); } diff --git a/frameworks/native/efilter/base/efilter.cpp b/frameworks/native/efilter/base/efilter.cpp index 000d9da..58e8f3b 100644 --- a/frameworks/native/efilter/base/efilter.cpp +++ b/frameworks/native/efilter/base/efilter.cpp @@ -107,6 +107,10 @@ ErrorCode EFilter::PreRender(IEffectFormat &format) std::shared_ptr GetPixelFormatCap(std::string &name) { std::shared_ptr pixelFormatCap = std::make_shared(); + if (pixelFormatCap == nullptr) { + EFFECT_LOGE("GetPixelFormatCap: PixelFormatCap fail! name=%{public}s", name.c_str()); + return pixelFormatCap; + } std::shared_ptr effectInfo = EFilterFactory::Instance()->GetEffectInfo(name); if (effectInfo == nullptr) { EFFECT_LOGE("GetPixelFormatCap: GetEffectInfo fail! name=%{public}s", name.c_str()); -- Gitee From 051afb63396ddc52b68e7641dbe5463461c21cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E5=8D=83=E9=87=8C?= Date: Thu, 24 Jul 2025 04:00:36 +0000 Subject: [PATCH 2/3] update frameworks/native/efilter/base/efilter.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 马千里 --- frameworks/native/efilter/base/efilter.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/frameworks/native/efilter/base/efilter.cpp b/frameworks/native/efilter/base/efilter.cpp index 58e8f3b..fc85784 100644 --- a/frameworks/native/efilter/base/efilter.cpp +++ b/frameworks/native/efilter/base/efilter.cpp @@ -107,10 +107,8 @@ ErrorCode EFilter::PreRender(IEffectFormat &format) std::shared_ptr GetPixelFormatCap(std::string &name) { std::shared_ptr pixelFormatCap = std::make_shared(); - if (pixelFormatCap == nullptr) { - EFFECT_LOGE("GetPixelFormatCap: PixelFormatCap fail! name=%{public}s", name.c_str()); - return pixelFormatCap; - } + CHECK_AND_RETURN_RET_LOG(pixelFormatCap != nullptr, pixelFormatCap, + "GetPixelFormatCap: PixelFormatCap fail! name=%{public}s", name.c_str()); std::shared_ptr effectInfo = EFilterFactory::Instance()->GetEffectInfo(name); if (effectInfo == nullptr) { EFFECT_LOGE("GetPixelFormatCap: GetEffectInfo fail! name=%{public}s", name.c_str()); -- Gitee From b38e3d8a288438842dd12c572ab51c681f736ea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E5=8D=83=E9=87=8C?= Date: Fri, 25 Jul 2025 09:51:44 +0000 Subject: [PATCH 3/3] update frameworks/native/capi/image_effect_filter.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 马千里 --- frameworks/native/capi/image_effect_filter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/native/capi/image_effect_filter.cpp b/frameworks/native/capi/image_effect_filter.cpp index 40826ec..44ac432 100644 --- a/frameworks/native/capi/image_effect_filter.cpp +++ b/frameworks/native/capi/image_effect_filter.cpp @@ -39,7 +39,7 @@ static std::vector> sOHFilterNames; void OH_EffectFilter::SetParameter(const std::string &key, Plugin::Any ¶m) { - CHECK_AND_RETURN_LOG(params_ != nullptr, "SetParameter: params_ is null!"); + CHECK_AND_RETURN_LOG(!key.empty(), "SetParameter: key is empty!"); params_.erase(key); params_.emplace(key, param); } -- Gitee