From 51e2d23521f99254f09fcc459e7b41600cb9f76d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 7 Feb 2015 20:55:58 +0000 Subject: coverity#1267681 Dereference before null check Change-Id: I629b12d53ef3bbadeb43e9555a8499252c1a1800 --- include/vcl/bmpacc.hxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/vcl') diff --git a/include/vcl/bmpacc.hxx b/include/vcl/bmpacc.hxx index bc43dbf175a9..f2f139921b58 100644 --- a/include/vcl/bmpacc.hxx +++ b/include/vcl/bmpacc.hxx @@ -348,14 +348,14 @@ inline Scanline BitmapReadAccess::GetBuffer() const inline Scanline BitmapReadAccess::GetScanline( long nY ) const { - assert(mpBuffer && "Access is not valid!"); + assert(mpBuffer && mpScanBuf && "Access is not valid!"); assert(nY < mpBuffer->mnHeight && "y-coordinate out of range!"); - return( mpBuffer ? mpScanBuf[ nY ] : NULL ); + return mpScanBuf[nY]; } inline BitmapColor BitmapReadAccess::GetPixel( long nY, long nX ) const { - assert(mpBuffer && "Access is not valid!"); + assert(mpBuffer && mpScanBuf && "Access is not valid!"); assert(nX < mpBuffer->mnWidth && "x-coordinate out of range!"); assert(nY < mpBuffer->mnHeight && "y-coordinate out of range!"); return mFncGetPixel( mpScanBuf[ nY ], nX, maColorMask ); -- cgit