From 8390cb1deffa1e1fdc46b7a61fedb7743de696cf Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Wed, 9 Jul 2025 15:17:52 +0900 Subject: [PATCH] renderer: ++exception handling --- src/renderer/tvgPaint.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/renderer/tvgPaint.cpp b/src/renderer/tvgPaint.cpp index b3056f07..23cd05b3 100644 --- a/src/renderer/tvgPaint.cpp +++ b/src/renderer/tvgPaint.cpp @@ -399,6 +399,7 @@ Shape* Paint::clip() const noexcept Result Paint::mask(Paint* target, MaskMethod method) noexcept { + if (method > MaskMethod::Darken) return Result::InvalidArguments; return pImpl->mask(target, method); } @@ -428,6 +429,7 @@ uint8_t Paint::opacity() const noexcept Result Paint::blend(BlendMethod method) noexcept { + if (method > BlendMethod::HardMix) return Result::InvalidArguments; //TODO: Remove later if (method == BlendMethod::Hue || method == BlendMethod::Saturation || method == BlendMethod::Color || method == BlendMethod::Luminosity || method == BlendMethod::HardMix) return Result::NonSupport; pImpl->blend(method);