You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ar...@apache.org on 2011/12/27 16:57:31 UTC

svn commit: r1224935 - /incubator/ooo/trunk/main/vcl/source/gdi/bitmap3.cxx

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;