summaryrefslogtreecommitdiff
path: root/sd/source/filter/ppt
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-07-23 16:52:14 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2020-07-24 20:13:52 +0200
commitbcdcdaa5dfc5f1d50e0239055161b71e97f5f022 (patch)
treedc95809f2fd5a5ed47b3176313ad5b051eb07454 /sd/source/filter/ppt
parent1aa69422be40368c988060c82706c8262f8de737 (diff)
throw if length of keys and values are different
See https://crashreport.libreoffice.org/stats/signature/%60anonymous%20namespace'::WriteAnimateValues This is expected to start rejecting broken files, instead of accepting invalid data silently, as it did before. This is not a regression, and should be indication of corrupted generator, which is the actual cause of the bug... Change-Id: I66dbb380e8b2d313e58cddf938d952aed4a635b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99327 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd/source/filter/ppt')
-rw-r--r--sd/source/filter/ppt/pptinanimations.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx
index be51eb9003e4..8516b063728a 100644
--- a/sd/source/filter/ppt/pptinanimations.cxx
+++ b/sd/source/filter/ppt/pptinanimations.cxx
@@ -48,6 +48,7 @@
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <com/sun/star/io/WrongFormatException.hpp>
#include <com/sun/star/presentation/ParagraphTarget.hpp>
#include <com/sun/star/presentation/TextAnimationType.hpp>
#include <comphelper/processfactory.hxx>
@@ -2212,6 +2213,10 @@ void AnimationImporter::importAnimateKeyPoints( const Atom* pAtom, const Referen
aKeyTimes[nKeyTime] = static_cast<double>(nKeyTime) / static_cast<double>(nKeyTimes - 1);
}
}
+
+ if (aValues.getLength() != aKeyTimes.getLength())
+ throw css::io::WrongFormatException();
+
xAnim->setKeyTimes( aKeyTimes );
xAnim->setValues( aValues );
xAnim->setFormula( aFormula );