Menu

#21 crashes when adding droping unsuported video to timeline

open
None
5
2007-02-27
2007-02-27
romgen
No

1. add avi with unsupported codec to project
2. drop that video to timeline --> crash

Solution: Add some NULL-checks to the code -->

a) File "SceneModell.cpp"
Add this lines

if(!clip)
return;

while function:

void SceneModel::addClipToModel(const Clip* clip, int iRow)
{
if(!clip)
return;

if (iRow < 0)
iRow = rowCount(QModelIndex());

insertRow(iRow, QModelIndex());
QModelIndex idx = index(iRow, 0, QModelIndex());
insertColumns(0, 2, idx);

QVariant v = qVariantFromValue((QObject*) clip);
setData(idx, clip->name(), Qt::DisplayRole);
setData(idx, v, ObjectPointerRole);
setData(idx, clip->id(), IdRole);

updatePropertiesInModel(idx);
}

b) File "TimelineManager.cpp":

add " if(clip){}"

whole function:

Span TimelineManager::addClips(const QList<QUrl>& urls, int sidx, QList<const Clip*>* pAddedClips)
{
Q_ASSERT(command() != NULL);
Q_ASSERT(sidx >= 0);
Q_ASSERT(pAddedClips != NULL);

// We can only paste between clips or into an empty area.
sidx = maybePrepareClipForPasting(sidx);

pAddedClips->clear();
int iInsertFrame = sidx;
int sidxVisibleLast = -1;
foreach (QUrl url, urls) {
const Clip* clip = command()->addClip(url.toLocalFile(), iInsertFrame);
if(clip)
{
if (m_bCascade) {
int nShift = clip->duration();
shiftAllClips(iInsertFrame, nShift, clip);
iInsertFrame += nShift;
}
*pAddedClips << clip;
sidxVisibleLast = clip->last(TimelineRef);
}
}

return Span(sidx, sidxVisibleLast - sidx + 1);
}

greetings and good work!

Discussion

  • romgen

    romgen - 2007-02-27
    • assigned_to: nobody --> whiteh12
     
  • Nicola Di Nisio

    Nicola Di Nisio - 2007-08-23

    Logged In: YES
    user_id=457606
    Originator: NO

    I confirm the crash with both avi and mov files generated by different cameras. They probably use unsupported codecs?
    Anyhow, tested on Kubuntu 7.04 Feisty Fawn i386.

     

Log in to post a comment.

MongoDB Logo MongoDB