You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by af...@apache.org on 2012/06/12 09:23:28 UTC

svn commit: r1349163 - /incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx

Author: af
Date: Tue Jun 12 07:23:27 2012
New Revision: 1349163

URL: http://svn.apache.org/viewvc?rev=1349163&view=rev
Log:
#i119502# Guard array access against invalid indices.

          Patch by: SunYing
          Review by: Andre


Modified:
    incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx

Modified: incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx?rev=1349163&r1=1349162&r2=1349163&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx Tue Jun 12 07:23:27 2012
@@ -2032,8 +2032,12 @@ sal_Int32 GetValueForEnhancedCustomShape
 	{
 		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 :