summaryrefslogtreecommitdiff
path: root/animations
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-05-31 20:35:26 +0200
committerStephan Bergmann <sbergman@redhat.com>2022-05-31 22:42:14 +0200
commitd1cdf9a24de0d87f22e283f5cb2ed93ff6e83ee6 (patch)
treeb9c6d42b42e4f18c3f2f3e4a004e2f858ae8936b /animations
parent93a3f142bf46eb7b4309cd168354fe2a971e196d (diff)
Also assert that nNodeType is non-negative
...given that nNodeType aka AnimationNode::mnNodeType is later used as an index into the AnimationNode::mpTypes array Change-Id: Ic208fbdfaa8dcca44ff2a99cf3b169904b14a4bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135203 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'animations')
-rw-r--r--animations/source/animcore/animcore.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/animations/source/animcore/animcore.cxx b/animations/source/animcore/animcore.cxx
index c02ba3ca2878..737da604a594 100644
--- a/animations/source/animcore/animcore.cxx
+++ b/animations/source/animcore/animcore.cxx
@@ -55,6 +55,7 @@
#include <cppuhelper/implbase.hxx>
+#include <o3tl/safeint.hxx>
#include <osl/mutex.hxx>
#include <sal/log.hxx>
#include <array>
@@ -446,7 +447,7 @@ AnimationNode::AnimationNode( sal_Int16 nNodeType )
mnIterateType( css::presentation::ShapeAnimationSubType::AS_WHOLE ),
mfIterateInterval(0.0)
{
- assert(nNodeType < int(mpTypes.size()));
+ assert(nNodeType >= 0 && o3tl::make_unsigned(nNodeType) < mpTypes.size());
}
AnimationNode::AnimationNode( const AnimationNode& rNode )