File Bail-out-if-stream-is-negative.patch of Package ffmpegthumbs4

From caf68da418658d99fa8e48db99b9733ef6697fa3 Mon Sep 17 00:00:00 2001
From: Kai Uwe Broulik <kde@privat.broulik.de>
Date: Tue, 5 Feb 2019 12:19:52 +0100
Subject: [PATCH] Bail out if stream is negative

Documentation says it returns "the non-negative stream number in case of success".

It can also return AVERROR_DECODER_NOT_FOUND which is -1381258232 and not -1,
leading to crashes when trying to preview video files without video streams.

Differential Revision: https://phabricator.kde.org/D18750
---
 ffmpegthumbnailer/moviedecoder.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffmpegthumbnailer/moviedecoder.cpp b/ffmpegthumbnailer/moviedecoder.cpp
index 6035be0..470c679 100644
--- a/ffmpegthumbnailer/moviedecoder.cpp
+++ b/ffmpegthumbnailer/moviedecoder.cpp
@@ -139,7 +139,7 @@ bool MovieDecoder::initializeVideo()
         }
     }
 
-    if (m_VideoStream == -1) {
+    if (m_VideoStream < 0) {
         kDebug() << "Could not find video stream";
         return false;
     }
-- 
GitLab

openSUSE Build Service is sponsored by