Commits

sj  committed 1a5ef64

os145: #b7001888# fixing small svm problem

  • Participants
  • Parent commits 38cc38f

Comments (0)

Files changed (1)

File vcl/source/gdi/metaact.cxx

 	rIStm	>> mnLen;
 	rIStm	>> nAryLen;
 
+	if ( mnIndex > mnLen )
+	{
+		mnIndex = 0;
+		mpDXAry = 0;
+		return;
+	}
+
 	if( nAryLen )
 	{
         // #i9762#, #106172# Ensure that DX array is at least mnLen entries long
-        const ULONG nIntAryLen( Max(nAryLen, static_cast<sal_uInt32>(mnLen)) );
-		mpDXAry = new sal_Int32[ nIntAryLen ];
-        
-        ULONG i;
-		for( i = 0UL; i < nAryLen; i++ )
-			rIStm >> mpDXAry[ i ];
-
-        // #106172# setup remainder
-		for( ; i < nIntAryLen; i++ )
-            mpDXAry[ i ] = 0;
+		if ( mnLen >= nAryLen )
+		{
+			mpDXAry = new (std::nothrow)sal_Int32[ mnLen ];
+			if ( mpDXAry )
+			{
+	       		ULONG i;
+				for( i = 0UL; i < nAryLen; i++ )
+					rIStm >> mpDXAry[ i ];
+
+				// #106172# setup remainder
+				for( ; i < mnLen; i++ )
+					mpDXAry[ i ] = 0;
+			}
+		}
+		else
+		{
+			mpDXAry = NULL;
+			return;
+		}
 	}
 	else
 		mpDXAry = NULL;