]> git.sesse.net Git - kdenlive/commitdiff
Fix possible clip corruption due to insufficient checking in duration dialog
authorTill Theato <root@ttill.de>
Sun, 20 Jun 2010 21:41:44 +0000 (21:41 +0000)
committerTill Theato <root@ttill.de>
Sun, 20 Jun 2010 21:41:44 +0000 (21:41 +0000)
svn path=/trunk/kdenlive/; revision=4536

src/clipdurationdialog.cpp
src/clipdurationdialog.h

index 18838af418fcde95b3bcf26be163496fdff61cc6..920ca288e522d709fc35e3bc3ffeaaf176a09172 100644 (file)
@@ -144,13 +144,14 @@ void ClipDurationDialog::slotCheckEnd()
 {
     GenTime cropStart = m_cropStart->gentime();
     GenTime cropEnd = m_cropEnd->gentime();
-    GenTime duration = m_clip->maxDuration() - cropStart - cropEnd;
+    GenTime duration = m_clip->maxDuration() - cropEnd - cropStart;
 
     if (duration >= GenTime()) {
         m_dur->setValue(duration);
+        slotCheckDuration();
     } else {
         m_cropEnd->blockSignals(true);
-        m_cropEnd->setValue(m_clip->maxDuration() - cropStart - m_dur->gentime());
+        m_cropEnd->setValue(m_clip->maxDuration() - m_dur->gentime() - cropStart);
         m_cropEnd->blockSignals(false);
     }
 }
index 7033c8f4739a7c9a6b18948cba4b97d1773d8846..27a8ee18c42376475f1db27b49f7ac7743964345 100644 (file)
 #include "timecodedisplay.h"
 #include "ui_clipdurationdialog_ui.h"
 
+/**
+ * @class ClipDurationDialog
+ * @brief A dialog for modifying an item's (clip or transition) duration. 
+ * @author Jean-Baptiste Mardelle
+ */
 
 class ClipDurationDialog : public QDialog, public Ui::ClipDurationDialog_UI
 {