From: "Andreas Sturmlechner" <asturm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/mlt/, media-libs/mlt/files/
Date: Sun, 8 Oct 2023 14:37:56 +0000 (UTC) [thread overview]
Message-ID: <1696775850.7175b838fce852b050cc031dcb5141d8499cb539.asturm@gentoo> (raw)
commit: 7175b838fce852b050cc031dcb5141d8499cb539
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 8 12:21:15 2023 +0000
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Oct 8 14:37:30 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7175b838
media-libs/mlt: Backport crash fixes post-7.20 release
Upstream commits:
482f1fb0179587575b3071f622df51a95895068a
09f55bf3d1fdcac06c5d297bb27cb4f3e7f85021
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
.../mlt/files/mlt-7.20.0-qtblend-crash.patch | 43 ++++++++++++++++++++++
.../mlt/files/mlt-7.20.0-rotoscoping-crash.patch | 22 +++++++++++
media-libs/mlt/mlt-7.20.0.ebuild | 3 ++
3 files changed, 68 insertions(+)
diff --git a/media-libs/mlt/files/mlt-7.20.0-qtblend-crash.patch b/media-libs/mlt/files/mlt-7.20.0-qtblend-crash.patch
new file mode 100644
index 000000000000..aad8f0e9e45c
--- /dev/null
+++ b/media-libs/mlt/files/mlt-7.20.0-qtblend-crash.patch
@@ -0,0 +1,43 @@
+From 09f55bf3d1fdcac06c5d297bb27cb4f3e7f85021 Mon Sep 17 00:00:00 2001
+From: Jean-Baptiste Mardelle <jb@kdenlive.org>
+Date: Thu, 5 Oct 2023 08:45:16 +0200
+Subject: [PATCH] Ensure qtblend doesn't request an image of 0 width or height
+ (crashes many filters)
+
+---
+ src/modules/qt/filter_qtblend.cpp | 6 +++---
+ src/modules/qt/transition_qtblend.cpp | 3 +++
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/src/modules/qt/filter_qtblend.cpp b/src/modules/qt/filter_qtblend.cpp
+index d54f7ccad..32d752d60 100644
+--- a/src/modules/qt/filter_qtblend.cpp
++++ b/src/modules/qt/filter_qtblend.cpp
+@@ -103,10 +103,10 @@ static int filter_get_image(mlt_frame frame,
+ || rect.h != *height;
+
+ if (mlt_properties_get_int(properties, "distort") == 0) {
+- b_height = qMin((int) rect.h, b_height);
+- b_width = b_height * b_dar / b_ar / consumer_ar;
++ b_height = qMax(1, qMin((int) rect.h, b_height));
++ b_width = qMax(1, int(b_height * b_dar / b_ar / consumer_ar));
+ } else {
+- b_width *= b_ar / consumer_ar;
++ b_width = qMax(1, int(b_width * b_ar / consumer_ar));
+ }
+ if (!hasAlpha && (b_width < *width || b_height < *height)) {
+ hasAlpha = true;
+diff --git a/src/modules/qt/transition_qtblend.cpp b/src/modules/qt/transition_qtblend.cpp
+index 9dbc795aa..0b41b3ff8 100644
+--- a/src/modules/qt/transition_qtblend.cpp
++++ b/src/modules/qt/transition_qtblend.cpp
+@@ -121,6 +121,9 @@ static int get_image(mlt_frame a_frame,
+ // we will process operations on top frame, so also process b_frame
+ forceAlpha = true;
+ }
++ // Ensure we don't request an image with a 0 width or height
++ b_width = qMax(1, b_width);
++ b_height = qMax(1, b_height);
+ } else {
+ b_height = *height;
+ b_width = *width;
diff --git a/media-libs/mlt/files/mlt-7.20.0-rotoscoping-crash.patch b/media-libs/mlt/files/mlt-7.20.0-rotoscoping-crash.patch
new file mode 100644
index 000000000000..124e1102b6d2
--- /dev/null
+++ b/media-libs/mlt/files/mlt-7.20.0-rotoscoping-crash.patch
@@ -0,0 +1,22 @@
+From 482f1fb0179587575b3071f622df51a95895068a Mon Sep 17 00:00:00 2001
+From: Jean-Baptiste Mardelle <jb@kdenlive.org>
+Date: Wed, 4 Oct 2023 22:26:13 +0200
+Subject: [PATCH] Fix rotoscoping filter crash on image with height = 0
+
+---
+ src/modules/plusgpl/filter_rotoscoping.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/modules/plusgpl/filter_rotoscoping.c b/src/modules/plusgpl/filter_rotoscoping.c
+index 35e3931f0..782c39422 100644
+--- a/src/modules/plusgpl/filter_rotoscoping.c
++++ b/src/modules/plusgpl/filter_rotoscoping.c
+@@ -337,7 +337,7 @@ static int filter_get_image(mlt_frame frame,
+ int offsetx = 0;
+ int offsety = 0;
+ // Compare aspect ratio
+- if (100 * *width / *height != 100 * normalized_width / normalized_height) {
++ if (*height > 0 && 100 * *width / *height != 100 * normalized_width / normalized_height) {
+ // Source has a different aspect ratio, apply scaling
+ double xfactor = normalized_width / *width;
+ double yfactor = normalized_height / *height;
diff --git a/media-libs/mlt/mlt-7.20.0.ebuild b/media-libs/mlt/mlt-7.20.0.ebuild
index db7be1c8207b..b84f4931436a 100644
--- a/media-libs/mlt/mlt-7.20.0.ebuild
+++ b/media-libs/mlt/mlt-7.20.0.ebuild
@@ -82,9 +82,12 @@ BDEPEND="
DOCS=( AUTHORS NEWS README.md )
PATCHES=(
+ # downstream
"${FILESDIR}"/${PN}-6.10.0-swig-underlinking.patch
"${FILESDIR}"/${PN}-6.22.1-no_lua_bdepend.patch
"${FILESDIR}"/${PN}-7.0.1-cmake-symlink.patch
+ # upstream (>=7.21.0)
+ "${FILESDIR}"/${P}-{rotoscoping,qtblend}-crash.patch
)
pkg_setup() {
next reply other threads:[~2023-10-08 14:37 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-08 14:37 Andreas Sturmlechner [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-10-02 21:27 [gentoo-commits] repo/gentoo:master commit in: media-libs/mlt/, media-libs/mlt/files/ Andreas Sturmlechner
2024-10-21 17:35 Andreas Sturmlechner
2024-01-07 14:33 Andreas Sturmlechner
2023-06-12 18:04 Sam James
2022-12-15 19:26 Andreas Sturmlechner
2022-04-29 4:25 Sam James
2021-08-05 1:48 Sam James
2021-04-24 21:40 Andreas Sturmlechner
2020-10-05 11:22 Andreas Sturmlechner
2020-06-30 21:44 Andreas Sturmlechner
2020-06-30 21:44 Andreas Sturmlechner
2020-06-30 21:44 Andreas Sturmlechner
2020-03-19 11:46 Andreas Sturmlechner
2018-12-12 11:56 Andreas Sturmlechner
2018-08-09 22:20 Andreas Sturmlechner
2018-07-22 21:50 Andreas Sturmlechner
2018-07-22 21:50 Andreas Sturmlechner
2018-07-22 21:50 Andreas Sturmlechner
2017-11-15 23:45 Andreas Sturmlechner
2017-10-28 12:17 Andreas Sturmlechner
2016-05-11 18:06 Michael Palimaka
2016-02-15 15:42 Alexis Ballier
2015-08-21 12:53 Alexis Ballier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1696775850.7175b838fce852b050cc031dcb5141d8499cb539.asturm@gentoo \
--to=asturm@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox