From: Vincent PINON Date: Sat, 14 Dec 2013 14:49:16 +0000 (+0100) Subject: coverity fix X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=2f9294f5de103de1a1a081375470da3571302d06;p=kdenlive coverity fix --- diff --git a/src/commands/moveeffectcommand.cpp b/src/commands/moveeffectcommand.cpp index 5be578e2..50d49e49 100644 --- a/src/commands/moveeffectcommand.cpp +++ b/src/commands/moveeffectcommand.cpp @@ -52,12 +52,14 @@ int MoveEffectCommand::id() const bool MoveEffectCommand::mergeWith(const QUndoCommand * other) { return false; + /* dead code (flaged by coverity), was removed to avoid crash when dropping on group if (other->id() != id()) return false; if (m_track != static_cast(other)->m_track) return false; if (m_pos != static_cast(other)->m_pos) return false; m_oldindex = static_cast(other)->m_oldindex; m_newindex = static_cast(other)->m_newindex; return true; + */ } // virtual diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp index f6f64b3b..c777d316 100644 --- a/src/customtrackview.cpp +++ b/src/customtrackview.cpp @@ -1224,8 +1224,10 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event) info.startPos = transitionClip->startPos(); } else { GenTime transitionDuration(65, m_document->fps()); - if (m_dragItem->cropDuration() < transitionDuration) info.startPos = m_dragItem->startPos(); - else info.startPos = info.endPos - transitionDuration; + if (m_dragItem->cropDuration() < transitionDuration) + info.startPos = m_dragItem->startPos(); + else + info.startPos = info.endPos - transitionDuration; } if (info.endPos == info.startPos) info.startPos = info.endPos - GenTime(65, m_document->fps()); QDomElement transition = MainWindow::transitions.getEffectByTag("luma", "dissolve").cloneNode().toElement(); diff --git a/src/doubleparameterwidget.cpp b/src/doubleparameterwidget.cpp index ec2af513..3281c674 100644 --- a/src/doubleparameterwidget.cpp +++ b/src/doubleparameterwidget.cpp @@ -32,6 +32,7 @@ DoubleParameterWidget::DoubleParameterWidget(const QString &name, double value, double min, double max, double defaultValue, const QString &comment, int id, const QString &suffix, int decimals, QWidget *parent) : + m_commentLabel(NULL), QWidget(parent) { setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Maximum); diff --git a/src/jogshuttle.cpp b/src/jogshuttle.cpp index 36ea3cd0..6a61812e 100644 --- a/src/jogshuttle.cpp +++ b/src/jogshuttle.cpp @@ -109,13 +109,15 @@ void ShuttleThread::run() int result, iof = -1; /* get fd settings */ - if ((iof = fcntl(fd, F_GETFL, 0)) != -1) { - /* set fd non blocking */ - fcntl(fd, F_SETFL, iof | O_NONBLOCK); - } else { - fprintf(stderr, "Can't set Jog Shuttle FILE DESCRIPTOR to O_NONBLOCK and stop thread\n"); - return; - } + if ((iof = fcntl(fd, F_GETFL, 0)) == -1) { + fprintf(stderr, "Can't get Jog Shuttle file status\n"); + close(fd); + return; + } else if (fcntl(fd, F_SETFL, iof | O_NONBLOCK) == -1) { + fprintf(stderr, "Can't set Jog Shuttle FILE DESCRIPTOR to O_NONBLOCK and stop thread\n"); + close(fd); + return; + } /* enter thread loop */ while (!stop_me) {