[Libreoffice-commits] core.git: vcl/source

Caolán McNamara caolanm at redhat.com
Mon Dec 12 09:51:35 UTC 2016


 vcl/source/window/paint.cxx |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit e43a712550946efd598387fc2bdd60a26637646f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Dec 12 09:50:43 2016 +0000

    coverity#1397054 silence bogus Dereference after null check
    
    Change-Id: Ifceb60ee9f1f5e0ba5fd68d88a0358b5400008ee

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 52b9e37..98f9bf9 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -690,12 +690,14 @@ void Window::ImplInvalidateFrameRegion( const vcl::Region* pRegion, InvalidateFl
         mpWindowImpl->mnPaintFlags |= ImplPaintFlags::PaintAllChildren;
     if ( !(nFlags & InvalidateFlags::NoErase) )
         mpWindowImpl->mnPaintFlags |= ImplPaintFlags::Erase;
+
     if ( !pRegion )
         mpWindowImpl->mnPaintFlags |= ImplPaintFlags::PaintAll;
-
-    // if not everything has to be redrawn, add the region to it
-    if ( !(mpWindowImpl->mnPaintFlags & ImplPaintFlags::PaintAll) )
+    else if ( !(mpWindowImpl->mnPaintFlags & ImplPaintFlags::PaintAll) )
+    {
+        // if not everything has to be redrawn, add the region to it
         mpWindowImpl->maInvalidateRegion.Union( *pRegion );
+    }
 
     // Handle transparent windows correctly: invalidate must be done on the first opaque parent
     if( ((IsPaintTransparent() && !(nFlags & InvalidateFlags::NoTransparent)) || (nFlags & InvalidateFlags::Transparent) )


More information about the Libreoffice-commits mailing list