From bad1f280d39f18b92aa2c6e79c9c65cc4b594fa7 Mon Sep 17 00:00:00 2001 From: Bionus Date: Sat, 3 Feb 2024 11:22:25 +0100 Subject: [PATCH] fix: properly catch invalid exit FFmpeg statuses --- src/lib/src/ffmpeg.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/src/ffmpeg.cpp b/src/lib/src/ffmpeg.cpp index c204270b5..d6a5d151c 100644 --- a/src/lib/src/ffmpeg.cpp +++ b/src/lib/src/ffmpeg.cpp @@ -167,7 +167,10 @@ bool FFmpeg::execute(const QStringList ¶ms, 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();