diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-07-18 13:12:31 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-07-18 15:36:14 +0100 |
commit | 2529a364d177c2b232917562d98c2bfcfe7da132 (patch) | |
tree | 3bcc6170aafd678c779711ec7a2944eb12fa1938 /cui | |
parent | f9b22d7c7a85de4f9bf95001d372ad8c6f8ff663 (diff) |
coverity#1226482 Dereference after null check
Change-Id: I2723812f960cde23c480651c9f8f5b26585fd51d
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/colorpicker.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx index 4b11fb5cf5ca..092c3823a59a 100644 --- a/cui/source/dialogs/colorpicker.cxx +++ b/cui/source/dialogs/colorpicker.cxx @@ -641,12 +641,15 @@ void ColorFieldControl::Paint( const Rectangle& rRect ) if( !mpBitmap ) UpdateBitmap(); - Bitmap aOutputBitmap( *mpBitmap ); + if (mpBitmap) + { + Bitmap aOutputBitmap( *mpBitmap ); - if( GetBitCount() <= 8 ) - aOutputBitmap.Dither(); + if( GetBitCount() <= 8 ) + aOutputBitmap.Dither(); - DrawBitmap( rRect.TopLeft(), rRect.GetSize(), rRect.TopLeft(), rRect.GetSize(), aOutputBitmap ); + DrawBitmap( rRect.TopLeft(), rRect.GetSize(), rRect.TopLeft(), rRect.GetSize(), aOutputBitmap ); + } // draw circle around current color if( maColor.IsDark() ) |