[Kdenlive-devel] [PATCH 03/16] effectstackview2.cpp: check for null

Mikko Rapeli mikko.rapeli at iki.fi
Fri Aug 10 12:17:04 UTC 2012


Fixes Coverity CID 709289: Explicit null dereferenced (FORWARD_NULL)
Assigning: "effectToMove" = 0.
790    CollapsibleEffect *effectToMove = NULL;
...
Passing null variable "effectToMove" to function "CollapsibleGroup::addGroupEffect(CollapsibleEffect *)", which dereferences it. [show details]
805    group->addGroupEffect(effectToMove);
---
 src/effectstack/effectstackview2.cpp |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/effectstack/effectstackview2.cpp b/src/effectstack/effectstackview2.cpp
index c345272..740518c 100644
--- a/src/effectstack/effectstackview2.cpp
+++ b/src/effectstack/effectstackview2.cpp
@@ -802,7 +802,8 @@ void EffectStackView2::slotCreateGroup(int ix)
     connectGroup(group);
     l->insertWidget(groupPos, group);
     group->installEventFilter( this );
-    group->addGroupEffect(effectToMove);
+    if (effectToMove)
+        group->addGroupEffect(effectToMove);
 }
 
 void EffectStackView2::connectGroup(CollapsibleGroup *group)
-- 
1.7.10.4





More information about the Kdenlive mailing list