[Kdenlive-devel] [PATCH 04/14] scopemanager.h: initialize pointers

Mikko Rapeli mikko.rapeli at iki.fi
Sun Jul 22 18:28:12 UTC 2012


Found by Coverity:

 31class ScopeManager : QObject
 32{
 33    Q_OBJECT
 34
 35    struct GfxScopeData {
CID 709313: Uninitialized pointer field (UNINIT_CTOR)
Class member declaration for ""scope"".
 36        AbstractGfxScopeWidget *scope;
Class member declaration for ""scopeDockWidget"".
 37        QDockWidget *scopeDockWidget;
 38        bool singleFrameRequested;
Non-static class member ""scope"" is not initialized in this constructor nor in any functions that it calls.
Non-static class member ""scopeDockWidget"" is not initialized in this constructor nor in any functions that it calls.
 39        GfxScopeData() { singleFrameRequested = false; }
 40    };
 41
 42    struct AudioScopeData {
CID 709314: Uninitialized pointer field (UNINIT_CTOR)
Class member declaration for ""scope"".
 43        AbstractAudioScopeWidget *scope;
Class member declaration for ""scopeDockWidget"".
 44        QDockWidget *scopeDockWidget;
 45        bool singleFrameRequested;
Non-static class member ""scope"" is not initialized in this constructor nor in any functions that it calls.
Non-static class member ""scopeDockWidget"" is not initialized in this constructor nor in any functions that it calls.
 46        AudioScopeData() { singleFrameRequested = false; }
 47    };
---
 src/scopes/scopemanager.h |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/scopes/scopemanager.h b/src/scopes/scopemanager.h
index 3ad8320..79b45e1 100644
--- a/src/scopes/scopemanager.h
+++ b/src/scopes/scopemanager.h
@@ -36,14 +36,22 @@ class ScopeManager : QObject
         AbstractGfxScopeWidget *scope;
         QDockWidget *scopeDockWidget;
         bool singleFrameRequested;
-        GfxScopeData() { singleFrameRequested = false; }
+        GfxScopeData() {
+            scope = NULL;
+            scopeDockWidget = NULL;
+            singleFrameRequested = false;
+        }
     };
 
     struct AudioScopeData {
         AbstractAudioScopeWidget *scope;
         QDockWidget *scopeDockWidget;
         bool singleFrameRequested;
-        AudioScopeData() { singleFrameRequested = false; }
+        AudioScopeData() {
+            scope = NULL;
+            scopeDockWidget = NULL;
+            singleFrameRequested = false; 
+        }
     };
 
 public:
-- 
1.7.10.4





More information about the Kdenlive mailing list