incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arie...@apache.org
Subject svn commit: r1224935 - /incubator/ooo/trunk/main/vcl/source/gdi/bitmap3.cxx
Date Tue, 27 Dec 2011 15:57:31 GMT
Author: arielch
Date: Tue Dec 27 15:57:31 2011
New Revision: 1224935

URL: http://svn.apache.org/viewvc?rev=1224935&view=rev
Log:
Prevent null pointer dereference

Modified:
    incubator/ooo/trunk/main/vcl/source/gdi/bitmap3.cxx

Modified: incubator/ooo/trunk/main/vcl/source/gdi/bitmap3.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/source/gdi/bitmap3.cxx?rev=1224935&r1=1224934&r2=1224935&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/source/gdi/bitmap3.cxx (original)
+++ incubator/ooo/trunk/main/vcl/source/gdi/bitmap3.cxx Tue Dec 27 15:57:31 2011
@@ -951,10 +951,13 @@ sal_Bool Bitmap::ImplScaleFast( const do
 	if( nNewWidth && nNewHeight )
 	{
 		BitmapReadAccess*	pReadAcc = AcquireReadAccess();
+        if ( !pReadAcc )
+            return sal_False;
+
 		Bitmap				aNewBmp( Size( nNewWidth, nNewHeight ), GetBitCount(), &pReadAcc->GetPalette()
);
 		BitmapWriteAccess*	pWriteAcc = aNewBmp.AcquireWriteAccess();
 
-		if( pReadAcc && pWriteAcc )
+		if( pWriteAcc )
 		{
 			const long	nScanlineSize = pWriteAcc->GetScanlineSize();
 			const long	nNewWidth1 = nNewWidth - 1L;



Mime
View raw message