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>
This commit is contained in:
Stephan Bergmann 2022-05-31 20:35:26 +02:00
parent 93a3f142bf
commit d1cdf9a24d

View file

@ -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 )