fix sigfpe on timecode function if the timebase isn't valid

This commit is contained in:
itsmattkc
2019-12-09 23:43:03 +11:00
parent 110c479954
commit 4bb874a154
5 changed files with 38 additions and 5 deletions
+4 -5
View File
@@ -33,15 +33,14 @@ QString olive::timestamp_to_timecode(const int64_t &timestamp,
const TimecodeDisplay& display,
bool show_plus_if_positive)
{
if (timebase.isNull()) {
return QString();
}
double timestamp_dbl = (rational(timestamp) * timebase).toDouble();
switch (display) {
case kTimecodeNonDropFrame:
// Convert timestamp from drop frame to non-drop frame
if (timebase.numerator() == 1001) {
timestamp_dbl = timestamp_dbl / timebase.flipped().toDouble() * (static_cast<double>(timebase.denominator())/1000.0);
}
/* fall-through */
case kTimecodeDropFrame:
case kTimecodeSeconds:
{
@@ -0,0 +1,6 @@
#include "crossdissolvetransition.h"
CrossDissolveTransition::CrossDissolveTransition()
{
}
@@ -0,0 +1,11 @@
#ifndef CROSSDISSOLVETRANSITION_H
#define CROSSDISSOLVETRANSITION_H
class CrossDissolveTransition
{
public:
CrossDissolveTransition();
};
#endif // CROSSDISSOLVETRANSITION_H
@@ -0,0 +1,6 @@
#include "diptoblacktransition.h"
DipToBlackTransition::DipToBlackTransition()
{
}
@@ -0,0 +1,11 @@
#ifndef DIPTOBLACKTRANSITION_H
#define DIPTOBLACKTRANSITION_H
class DipToBlackTransition
{
public:
DipToBlackTransition();
};
#endif // DIPTOBLACKTRANSITION_H