Fix crash on composition resize

parent 4d0fad0a
......@@ -703,7 +703,7 @@ QString KeyframeModel::getAnimProperty() const
}
int ix = 0;
bool first = true;
std::shared_ptr<Mlt::Animation> anim;
std::shared_ptr<Mlt::Animation> anim(nullptr);
for (const auto &keyframe : m_keyframeList) {
if (first) {
switch (m_paramType) {
......@@ -731,9 +731,12 @@ QString KeyframeModel::getAnimProperty() const
anim->key_set_type(ix, convertToMltType(keyframe.second.first));
ix++;
}
char *cut = anim->serialize_cut();
QString ret(cut);
free(cut);
QString ret;
if (anim) {
char *cut = anim->serialize_cut();
ret = QString(cut);
free(cut);
}
return ret;
}
......
......@@ -384,7 +384,7 @@ void KeyframeModelList::resizeKeyframes(int oldIn, int oldOut, int in, int out,
}
}
}
} else {
} else if (oldIn != in) {
GenTime old_in(oldIn, pCore->getCurrentFps());
GenTime new_in(in, pCore->getCurrentFps());
Keyframe kf = getKeyframe(old_in, &ok);
......@@ -418,7 +418,6 @@ void KeyframeModelList::resizeKeyframes(int oldIn, int oldOut, int in, int out,
break;
}
}
// qDebug()<<"/// \n\nKEYS TO DELETE: "<<positions<<"\n------------------------";
}
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment