diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-07-23 16:52:14 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-07-24 20:13:52 +0200 |
commit | bcdcdaa5dfc5f1d50e0239055161b71e97f5f022 (patch) | |
tree | dc95809f2fd5a5ed47b3176313ad5b051eb07454 /xmloff | |
parent | 1aa69422be40368c988060c82706c8262f8de737 (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 'xmloff')
-rw-r--r-- | xmloff/source/draw/animationimport.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx index b05d6e398b79..777deb36d3bb 100644 --- a/xmloff/source/draw/animationimport.cxx +++ b/xmloff/source/draw/animationimport.cxx @@ -38,6 +38,7 @@ #include <com/sun/star/animations/Timing.hpp> #include <com/sun/star/animations/Event.hpp> #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/io/WrongFormatException.hpp> #include <com/sun/star/xml/sax/XFastAttributeList.hpp> #include <com/sun/star/text/XTextCursor.hpp> #include <com/sun/star/text/XTextRangeCompare.hpp> @@ -1124,8 +1125,15 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: if( !aValues.isEmpty() ) xAnimate->setValues( mpHelper->convertValueSequence( meAttributeName, aValues ) ); + + if (xAnimate->getValues().getLength() != xAnimate->getKeyTimes().getLength()) + throw css::io::WrongFormatException(); } } + catch (const css::io::WrongFormatException&) + { + throw; + } catch (const RuntimeException&) { OSL_FAIL( "xmloff::AnimationNodeContext::StartElement(), RuntimeException caught!" ); |