incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1349163 - /incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx
Date Tue, 12 Jun 2012 07:23:28 GMT
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 :



Mime
View raw message