Skip to content

Commit

Permalink
fix: properly catch invalid exit FFmpeg statuses
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Feb 3, 2024
1 parent c1cf658 commit bad1f28
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/src/ffmpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@ bool FFmpeg::execute(const QStringList &params, int msecs)
}

// Wait for FFmpeg to finish
bool ok = process.waitForFinished(msecs);
bool finishedOk = process.waitForFinished(msecs);
bool didntCrash = process.exitStatus() == QProcess::NormalExit;
bool exitCodeOk = process.exitCode() == 0;
bool ok = finishedOk && didntCrash && exitCodeOk;

// Print stdout and stderr to the log
const QString standardOutput = QString::fromLocal8Bit(process.readAllStandardOutput()).trimmed();
Expand Down

0 comments on commit bad1f28

Please sign in to comment.