summaryrefslogtreecommitdiff
path: root/media-libs/mlt/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-10-08 18:03:40 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-10-08 18:03:40 +0100
commit418459f7de9eb29d6db8b61681f39c467d9600e1 (patch)
tree87b23e3d06e1b08b13c64e16503aa7ea88b38a8a /media-libs/mlt/files
parent522fa4e6f267ba688a264ceec8d6c79663b61219 (diff)
gentoo auto-resync : 08:10:2023 - 18:03:40
Diffstat (limited to 'media-libs/mlt/files')
-rw-r--r--media-libs/mlt/files/mlt-7.20.0-qtblend-crash.patch43
-rw-r--r--media-libs/mlt/files/mlt-7.20.0-rotoscoping-crash.patch22
2 files changed, 65 insertions, 0 deletions
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;