File workspace.impress178.diff of Package OpenOffice_org-libs-gui

Index: svtools/source/filter.vcl/ixpm/xpmread.cxx
===================================================================
--- svtools/source/filter.vcl/ixpm/xpmread.cxx	(.../tags/DEV300_m60)	(revision 276951)
+++ svtools/source/filter.vcl/ixpm/xpmread.cxx	(.../cws/impress178)	(revision 276951)
@@ -109,6 +109,10 @@
 				mnColors = ImplGetULONG( 2 );
 				mnCpp = ImplGetULONG( 3 );
 			}
+			if ( mnColors > ( SAL_MAX_UINT32 / ( 4 + mnCpp ) ) )
+				mbStatus = sal_False;
+			if ( ( mnWidth * mnCpp ) >= XPMSTRINGBUF )
+				mbStatus = sal_False;
 			if ( mbStatus && mnWidth && mnHeight && mnColors && mnCpp )
 			{
 				mnIdentifier = XPMCOLORS;
@@ -118,15 +122,20 @@
 				//			    1    Byte	-> 0xff wenn Farbe transparent ist
 				//				3    Bytes  -> RGB Wert der Farbe
 				mpColMap = new BYTE[ mnColors * ( 4 + mnCpp ) ];
-
-				for ( ULONG i = 0; i < mnColors; i++ )
+				if ( mpColMap )
 				{
-					if ( ImplGetColor( i ) == FALSE )
+					for ( ULONG i = 0; i < mnColors; i++ )
 					{
-						mbStatus = FALSE;
-						break;
+						if ( ImplGetColor( i ) == FALSE )
+						{
+							mbStatus = FALSE;
+							break;
+						}
 					}
 				}
+				else
+					mbStatus = sal_False;
+
 				if ( mbStatus )
 				{
 					// bei mehr als 256 Farben wird eine 24 Bit Grafik erstellt
@@ -630,7 +639,7 @@
 				mnStatus &=~XPMSTRING;			// end of parameter by eol
 				break;
 			}
-			if ( mnStringSize >= XPMSTRINGBUF )
+			if ( mnStringSize >= ( XPMSTRINGBUF - 1 ) )
 			{
 				mbStatus = FALSE;
 				break;
Index: svtools/source/filter.vcl/igif/decode.cxx
===================================================================
--- svtools/source/filter.vcl/igif/decode.cxx	(.../tags/DEV300_m60)	(revision 276951)
+++ svtools/source/filter.vcl/igif/decode.cxx	(.../cws/impress178)	(revision 276951)
@@ -51,7 +51,6 @@
 			bEOIFound			( FALSE ),
 			nDataSize			( cDataSize )
 {
-	pTable = new GIFLZWTableEntry[ 4096 ];
 	pOutBuf	= new BYTE[ 4096 ];
 
 	nClearCode = 1 << nDataSize;
@@ -61,6 +60,8 @@
 	nOldCode = 0xffff;
 	pOutBufData = pOutBuf + 4096;
 
+	pTable = new GIFLZWTableEntry[ 4098 ];
+
 	for( USHORT i = 0; i < nTableSize; i++ )
 	{
 		pTable[i].pPrev = NULL;

openSUSE Build Service is sponsored by