diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2023-12-04 11:31:36 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2023-12-04 18:00:43 +0100 |
commit | b50da6f3a9109fc1d4468c15aa7d5c68773ec199 (patch) | |
tree | e789d75d5457c4a3386e70cef341cac2b2477730 /slideshow | |
parent | 1597968f5cd2534fb6e0be40fafecc305a004f4e (diff) |
cid#1546275 Using invalid iterator
and :
cid#1546219 Using invalid iterator
cid#1546088 Using invalid iterator
cid#1546070 Using invalid iterator
cid#1546061 Using invalid iterator
cid#1546055 Using invalid iterator
cid#1546049 Using invalid iterator
Change-Id: I6f3a786852b5c262d60c3195e446a37967ed9b59
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160311
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'slideshow')
-rw-r--r-- | slideshow/source/engine/box2dtools.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/slideshow/source/engine/box2dtools.cxx b/slideshow/source/engine/box2dtools.cxx index 97e172a4eb4e..161bbe8c37f4 100644 --- a/slideshow/source/engine/box2dtools.cxx +++ b/slideshow/source/engine/box2dtools.cxx @@ -323,7 +323,9 @@ void box2DWorld::setShapeAngleByAngularVelocity( assert(mpBox2DWorld); if (fPassedTime > 0) // this only makes sense if there was an advance in time { - Box2DBodySharedPtr pBox2DBody = mpXShapeToBodyMap.find(xShape)->second; + const auto iter = mpXShapeToBodyMap.find(xShape); + assert(iter != mpXShapeToBodyMap.end()); + Box2DBodySharedPtr pBox2DBody = iter->second; pBox2DBody->setAngleByAngularVelocity(fAngle, fPassedTime); } } @@ -561,7 +563,9 @@ void box2DWorld::queueShapeAnimationEndUpdate( void box2DWorld::alertPhysicsAnimationEnd(const slideshow::internal::ShapeSharedPtr& pShape) { - Box2DBodySharedPtr pBox2DBody = mpXShapeToBodyMap.find(pShape->getXShape())->second; + const auto iter = mpXShapeToBodyMap.find(pShape->getXShape()); + assert(iter != mpXShapeToBodyMap.end()); + Box2DBodySharedPtr pBox2DBody = iter->second; // since the animation ended make the body static makeBodyStatic(pBox2DBody); pBox2DBody->setRestitution(fDefaultStaticBodyBounciness); |