summaryrefslogtreecommitdiff
path: root/user/qt5-qtmultimedia/kde-lts.patch
diff options
context:
space:
mode:
Diffstat (limited to 'user/qt5-qtmultimedia/kde-lts.patch')
-rw-r--r--user/qt5-qtmultimedia/kde-lts.patch106
1 files changed, 53 insertions, 53 deletions
diff --git a/user/qt5-qtmultimedia/kde-lts.patch b/user/qt5-qtmultimedia/kde-lts.patch
index 510e88d18..f939c1a85 100644
--- a/user/qt5-qtmultimedia/kde-lts.patch
+++ b/user/qt5-qtmultimedia/kde-lts.patch
@@ -1,64 +1,64 @@
-From c75ef0bb53562a62d67fb3247c9fc138356368b4 Mon Sep 17 00:00:00 2001
-From: Marc Mutz <marc.mutz@qt.io>
-Date: Thu, 19 May 2022 12:02:04 +0200
-Subject: [PATCH] QPulseAudioSource: fix UB (memcpy() called with nullptr dest)
- in read()
+From 39233709c321a572ec071c97e417347ea67824f7 Mon Sep 17 00:00:00 2001
+From: Joshua Goins <josh@redstrate.com>
+Date: Sun, 22 Jan 2023 10:39:59 -0500
+Subject: [PATCH 1/2] Pass explicit GL api when initializing GStreamer backend
-deviceReady() calls read(nullptr, 0), but calling memcpy() with a
-nullpt destination is UB, even if the length is simulateneously zero.
+Recent GStreamer versions now require an explicit API instead of
+GST_GL_API_ANY, so now we pass GL or GLES depending on what is used.
-Ditto applyVolume() (called from read()).
+Cherrypicked from 20153c34a4a46a755f8a48502f0ad36d01de2e98
+---
+ src/gsttools/qgstvideorenderersink.cpp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/gsttools/qgstvideorenderersink.cpp b/src/gsttools/qgstvideorenderersink.cpp
+index 4000f2178..a446d93fe 100644
+--- a/src/gsttools/qgstvideorenderersink.cpp
++++ b/src/gsttools/qgstvideorenderersink.cpp
+@@ -368,7 +368,8 @@ static GstGLContext *gstGLDisplayContext(QAbstractVideoSurface *surface)
+ if (!nativeContext)
+ qWarning() << "Could not find resource for" << contextName;
+
+- GstGLContext *appContext = gst_gl_context_new_wrapped(display, (guintptr)nativeContext, glPlatform, GST_GL_API_ANY);
++ GstGLAPI glApi = QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL ? GST_GL_API_OPENGL : GST_GL_API_GLES2;
++ GstGLContext *appContext = gst_gl_context_new_wrapped(display, (guintptr)nativeContext, glPlatform, glApi);
+ if (!appContext)
+ qWarning() << "Could not create wrappped context for platform:" << glPlatform;
+
+--
+2.49.0
+
+From d342547886448dacf38d2933cd40322c7435ee86 Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <asturm@gentoo.org>
+Date: Fri, 17 Sep 2021 10:14:42 +0200
+Subject: [PATCH 2/2] Drop obsolete QtOpengl dependency
-Fix by guarding the memcpy() calls.
+Widgets were ported away from QtOpenGL in 5.15.0 but bogus dependency
+remained (commit 30034a140ca8aefa1986c9964ae1f30dcfef886e).
-Add assertions to indicate that for these functions, nullptr is valid
-input iff length is zero.
+See also: https://bugreports.qt.io/browse/QTBUG-81902
-Found by clangsa's core.NonNullParamChecker.
+qmake backport of upstream dev branch commit a7621a6db7bdbe514be825cbc2952d50e328bab4
-Pick-to: 6.3 6.2 5.15
-Change-Id: I9006b0e933e196a7a212e0ebe2bd27f6b9552518
-Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
-(cherry picked from commit 8df415d5bcf23462bedb4cb7601b909851ee15dd)
+Thanks-to: Davide Pesavento <pesa@gentoo.org>
+Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
---
- src/plugins/pulseaudio/qaudioinput_pulse.cpp | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
+ src/multimediawidgets/multimediawidgets.pro | 2 --
+ 1 file changed, 2 deletions(-)
-diff --git a/src/plugins/pulseaudio/qaudioinput_pulse.cpp b/src/plugins/pulseaudio/qaudioinput_pulse.cpp
-index 2b5325132..b68b4af1b 100644
---- a/src/plugins/pulseaudio/qaudioinput_pulse.cpp
-+++ b/src/plugins/pulseaudio/qaudioinput_pulse.cpp
-@@ -402,6 +402,8 @@ int QPulseAudioInput::bytesReady() const
-
- qint64 QPulseAudioInput::read(char *data, qint64 len)
- {
-+ Q_ASSERT(data != nullptr || len == 0);
-+
- m_bytesAvailable = checkBytesReady();
-
- setError(QAudio::NoError);
-@@ -411,7 +413,8 @@ qint64 QPulseAudioInput::read(char *data, qint64 len)
-
- if (!m_pullMode && !m_tempBuffer.isEmpty()) {
- readBytes = qMin(static_cast<int>(len), m_tempBuffer.size());
-- memcpy(data, m_tempBuffer.constData(), readBytes);
-+ if (readBytes)
-+ memcpy(data, m_tempBuffer.constData(), readBytes);
- m_totalTimeValue += readBytes;
-
- if (readBytes < m_tempBuffer.size()) {
-@@ -502,9 +505,10 @@ qint64 QPulseAudioInput::read(char *data, qint64 len)
-
- void QPulseAudioInput::applyVolume(const void *src, void *dest, int len)
- {
-+ Q_ASSERT((src && dest) || len == 0);
- if (m_volume < 1.f)
- QAudioHelperInternal::qMultiplySamples(m_volume, m_format, src, dest, len);
-- else
-+ else if (len)
- memcpy(dest, src, len);
- }
+diff --git a/src/multimediawidgets/multimediawidgets.pro b/src/multimediawidgets/multimediawidgets.pro
+index 1919e8107..4c30d8fbf 100644
+--- a/src/multimediawidgets/multimediawidgets.pro
++++ b/src/multimediawidgets/multimediawidgets.pro
+@@ -2,8 +2,6 @@
+ TARGET = QtMultimediaWidgets
+ QT = core gui multimedia widgets-private
+ QT_PRIVATE += multimedia-private
+-qtHaveModule(opengl): \
+- QT_PRIVATE += opengl
+ PRIVATE_HEADERS += \
+ qvideowidget_p.h \
--
-2.36.0
+2.49.0