KDE Applications 18.08.3

OBS-URL: https://build.opensuse.org/package/show/KDE:Applications/ffmpegthumbs?expand=0&rev=125
This commit is contained in:
Wolfgang Bauer 2018-11-09 22:38:24 +00:00 committed by Git OBS Bridge
parent eccaf62beb
commit f2ae92d423
5 changed files with 16 additions and 97 deletions

View File

@ -1,90 +0,0 @@
From 477fe05f410852b78d44243a796c73dda2165398 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fabian@ritter-vogt.de>
Date: Sat, 3 Nov 2018 11:41:56 +0100
Subject: [PATCH] Don't crash if initializeVideo fails
Summary:
If avcodec_find_decoder returns NULL, a warning is printed and then NULL is
dereferenced later...
Test Plan:
A user crashed thumbnail.so reproducably with a specific file.
Doesn't anymore with this patch applied.
Reviewers: broulik
Differential Revision: https://phabricator.kde.org/D16631
---
ffmpegthumbnailer/moviedecoder.cpp | 14 ++++++++++----
ffmpegthumbnailer/moviedecoder.h | 2 +-
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/ffmpegthumbnailer/moviedecoder.cpp b/ffmpegthumbnailer/moviedecoder.cpp
index 6d1a79c..207e36b 100644
--- a/ffmpegthumbnailer/moviedecoder.cpp
+++ b/ffmpegthumbnailer/moviedecoder.cpp
@@ -73,7 +73,10 @@ void MovieDecoder::initialize(const QString& filename)
return;
}
- initializeVideo();
+ if (!initializeVideo()) {
+ // It already printed a message
+ return;
+ }
m_pFrame = av_frame_alloc();
if (m_pFrame) {
@@ -126,7 +129,7 @@ QString MovieDecoder::getCodec()
return codecName;
}
-void MovieDecoder::initializeVideo()
+bool MovieDecoder::initializeVideo()
{
for (unsigned int i = 0; i < m_pFormatContext->nb_streams; i++) {
if (m_pFormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
@@ -138,7 +141,7 @@ void MovieDecoder::initializeVideo()
if (m_VideoStream == -1) {
qDebug() << "Could not find video stream";
- return;
+ return false;
}
m_pVideoCodecContext = m_pFormatContext->streams[m_VideoStream]->codec;
@@ -148,14 +151,17 @@ void MovieDecoder::initializeVideo()
// set to NULL, otherwise avcodec_close(m_pVideoCodecContext) crashes
m_pVideoCodecContext = NULL;
qDebug() << "Video Codec not found";
- return;
+ return false;
}
m_pVideoCodecContext->workaround_bugs = 1;
if (avcodec_open2(m_pVideoCodecContext, m_pVideoCodec, 0) < 0) {
qDebug() << "Could not open video codec";
+ return false;
}
+
+ return true;
}
int MovieDecoder::getWidth()
diff --git a/ffmpegthumbnailer/moviedecoder.h b/ffmpegthumbnailer/moviedecoder.h
index 060c02e..eadc8e2 100644
--- a/ffmpegthumbnailer/moviedecoder.h
+++ b/ffmpegthumbnailer/moviedecoder.h
@@ -51,7 +51,7 @@ public:
bool getInitialized();
private:
- void initializeVideo();
+ bool initializeVideo();
bool decodeVideoPacket();
bool getVideoPacket();
--
2.19.0

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9ee67594e3e9405d2423ec77ac2d63580a4fb437a9fd01a3a92565a4b7a07c15
size 21836

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1bc92e4e032c50fa6652450f413160a7629f8394d540bd31a246c3ce731cab9f
size 21860

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Thu Nov 08 20:43:28 UTC 2018 - lbeltrame@kde.org
- Update to 18.08.3
* New bugfix release
* For more details please see:
* https://www.kde.org/announcements/announce-applications-18.08.3.php
- Changes since 18.08.2:
* Don't crash if initializeVideo fails
- Dropped patches, now upstream:
* 0001-Don-t-crash-if-initializeVideo-fails.patch
-------------------------------------------------------------------
Sat Nov 3 10:43:00 UTC 2018 - Fabian Vogt <fabian@ritter-vogt.de>

View File

@ -17,7 +17,7 @@
Name: ffmpegthumbs
Version: 18.08.2
Version: 18.08.3
Release: 0
%define kf5_version 5.26.0
# Latest stable Applications (e.g. 17.08 in KA, but 17.11.80 in KUA)
@ -27,8 +27,6 @@ License: LGPL-2.0-or-later
Group: System/GUI/KDE
Url: http://www.kde.org
Source0: %{name}-%{version}.tar.xz
# PATCH-FIX-UPSTREAM
Patch1: 0001-Don-t-crash-if-initializeVideo-fails.patch
BuildRequires: extra-cmake-modules
BuildRequires: kf5-filesystem
BuildRequires: ki18n-devel
@ -48,7 +46,6 @@ FFmpeg-based thumbnail creator for video files.
%prep
%setup -q
%autopatch -p1
%build
%cmake_kf5 -d build