[Libreoffice-commits] core.git: filter/source

Michael Meeks michael.meeks at suse.com
Fri Mar 8 09:20:16 PST 2013


 filter/source/msfilter/escherex.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit ef760707dc094b1f88f3dd69fb9aecd9b647ee2e
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Fri Mar 8 17:15:25 2013 +0000

    avoid signedness issue in bounds check.
    
    Change-Id: Iae4b489486be95072859b13a4bd5ae1260e3c024

diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index aa387ac..7fbe40a 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1962,10 +1962,11 @@ sal_Int32 GetValueForEnhancedCustomShapeParameter( const com::sun::star::drawing
     {
         case com::sun::star::drawing::EnhancedCustomShapeParameterType::EQUATION :
         {
-            OSL_ASSERT(nValue < static_cast<sal_Int32>(rEquationOrder.size()));
-            if ( nValue < static_cast<sal_Int32>(rEquationOrder.size()) )
+            size_t nIndex = (size_t) nValue;
+            OSL_ASSERT(nIndex < rEquationOrder.size());
+            if ( nIndex < rEquationOrder.size() )
             {
-                nValue = (sal_uInt16)rEquationOrder[ nValue ];
+                nValue = (sal_uInt16)rEquationOrder[ nIndex ];
                 nValue |= (sal_uInt32)0x80000000;
             }
         }


More information about the Libreoffice-commits mailing list