summaryrefslogtreecommitdiff
path: root/filter/source/msfilter/escherex.cxx
diff options
context:
space:
mode:
authorAndre Fischer <af@apache.org>2012-06-12 06:23:27 +0000
committerMichael Meeks <michael.meeks@suse.com>2013-03-08 16:09:10 +0000
commit6bf213237139cf1dbea3b793a90a0245872f1110 (patch)
treeadd5a1a6da51cd0344bfb5a5dcb102b711e84fac /filter/source/msfilter/escherex.cxx
parentefb912f81c84de0847b525569bfe97b9da2b01f0 (diff)
#i119502# Guard array access against invalid indices.
Patch by: SunYing Review by: Andre
Diffstat (limited to 'filter/source/msfilter/escherex.cxx')
-rw-r--r--filter/source/msfilter/escherex.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 81a12ed86b00..5d5809b7f78c 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1962,8 +1962,12 @@ sal_Int32 GetValueForEnhancedCustomShapeParameter( const com::sun::star::drawing
{
case com::sun::star::drawing::EnhancedCustomShapeParameterType::EQUATION :
{
- nValue = (sal_uInt16)rEquationOrder[ nValue ];
- nValue |= (sal_uInt32)0x80000000;
+ OSL_ASSERT(nValue < rEquationOrder.size());
+ if ( nValue < rEquationOrder.size() )
+ {
+ nValue = (sal_uInt16)rEquationOrder[ nValue ];
+ nValue |= (sal_uInt32)0x80000000;
+ }
}
break;
case com::sun::star::drawing::EnhancedCustomShapeParameterType::NORMAL :