[Kdenlive-devel] [PATCH 12/16] projectlistview.cpp: check for null pointer

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


Fixes Coverity CID 709291: Explicit null dereferenced (FORWARD_NULL)
Passing null variable "item" to function "FolderProjectItem::groupName() const", which dereferences it. [show details]
272                        props.insert("groupname", item->groupName());
...
Assigning: "item" = 0.
276                } else item = NULL;
---
 src/projectlistview.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/projectlistview.cpp b/src/projectlistview.cpp
index f5b8a88..e4a2641 100644
--- a/src/projectlistview.cpp
+++ b/src/projectlistview.cpp
@@ -266,7 +266,7 @@ void ProjectListView::dropEvent(QDropEvent *event)
                 if (it->type() == PROJECTCLIPTYPE) {
                     if (it->parent()) clone = (ProjectItem*) it->parent()->takeChild(it->parent()->indexOfChild(it));
                     else clone = (ProjectItem*) takeTopLevelItem(indexOfTopLevelItem(it));
-                    if (clone) {
+                    if (clone && item) {
                         item->addChild(clone);
                         QMap <QString, QString> props;
                         props.insert("groupname", item->groupName());
-- 
1.7.10.4





More information about the Kdenlive mailing list