[Kdenlive-devel] Coverity

Mikko Rapeli mikko.rapeli at iki.fi
Mon Dec 2 18:46:35 UTC 2013


Hi all,

I did another Coverity static analysis run for kdenlive 0.9 branch and
results are available at https://scan.coverity.com/ .

At the moment only me and JBM are members of the kdenlive Coverity project
and can view results, but anyone else is free to join in as well.
Just create an account into https://scan.coverity.com/ and apply for Kdenlive
(or MLT-FRAMEWORK) projects, and after I've accepted that you can browse the
results. Coverity results can not be completely opened up so this registration
is necessary.

There are 30 new findings some of which are really simple to fix without
deep understanding of kdenlive code. Naturally some testing for patches
would be good, so prepare by building mlt and kdenlive on your machine first.

An example of Coverity findings from kdenlive:

src/clipproperties.cpp:

(not showing the complete and very long path to this)

 708        if (commonproperties.value("out").toInt() > 0) {
 709            m_view.clip_force_out->setChecked(true);
 710            m_view.clip_out->setText(m_tc.getTimecodeFromFrames(commonproperties.value("out").toInt()));
    	33. Falling through to end of if statement
 711        } else {
 712            m_view.clip_out->setText(KdenliveSettings::image_duration());
 713        }
    	34. Falling through to end of if statement
 714    } else {
 715        m_view.clip_force_out->setHidden(true);
 716        m_view.clip_out->setHidden(true);
 717    }
    	
CID 1134139 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
36. uninit_member: Non-static class member "m_proxyContainer" is not initialized in this constructor nor in any functions that it calls.
 718}

A fix should be something like this to initialize this pointer variable to
NULL:

--- a/src/clipproperties.cpp
+++ b/src/clipproperties.cpp
@@ -581,7 +581,8 @@ ClipProperties::ClipProperties(const QList <DocClipBase *> &cliplist, const Time
     m_fps(0),
     m_count(0),
     m_clipNeedsRefresh(false),
-    m_clipNeedsReLoad(false)
+    m_clipNeedsReLoad(false),
+    m_proxyContainer(NULL)
 {
     setFont(KGlobalSettings::toolBarFont());
     m_view.setupUi(this);

Seeing sometimes random and crashing behaviour with kdenlive? This might
just fix that.

I hope to see some applications to kdenlive Coverity project! And why not
MLT as well while at it, couple of new findings there as well.

Cheers,

-Mikko




More information about the Kdenlive mailing list