summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2018-07-22 22:11:37 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2018-07-22 23:49:15 +0200
commit9d08e036fc964ca46457d1784c244fb6b34b6284 (patch)
tree54cd9d87bb32ff6a0aa30ea4b1a1f8b9f0d12a33 /media-libs/mlt/files
parentmedia-libs/mlt: Fix libav build errors (diff)
downloadgentoo-9d08e036fc964ca46457d1784c244fb6b34b6284.tar.gz
gentoo-9d08e036fc964ca46457d1784c244fb6b34b6284.tar.bz2
gentoo-9d08e036fc964ca46457d1784c244fb6b34b6284.zip
media-libs/mlt: Fix png 8-bit segfault
Package-Manager: Portage-2.3.43, Repoman-2.3.10
Diffstat (limited to 'media-libs/mlt/files')
-rw-r--r--media-libs/mlt/files/mlt-6.6.0-png-segfault.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/media-libs/mlt/files/mlt-6.6.0-png-segfault.patch b/media-libs/mlt/files/mlt-6.6.0-png-segfault.patch
new file mode 100644
index 000000000000..c93458a8273b
--- /dev/null
+++ b/media-libs/mlt/files/mlt-6.6.0-png-segfault.patch
@@ -0,0 +1,36 @@
+From e013fd7c2f49b40a1b482d712d531329d538da88 Mon Sep 17 00:00:00 2001
+From: Brian Matherly <code@brianmatherly.com>
+Date: Wed, 31 Jan 2018 20:57:42 -0600
+Subject: [PATCH] Fix segmentation fault when using qimage png producer #296
+
+---
+ src/modules/qt/qimage_wrapper.cpp | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/src/modules/qt/qimage_wrapper.cpp b/src/modules/qt/qimage_wrapper.cpp
+index 436f65d15..99b4ebf8e 100644
+--- a/src/modules/qt/qimage_wrapper.cpp
++++ b/src/modules/qt/qimage_wrapper.cpp
+@@ -229,18 +229,19 @@ void refresh_image( producer_qimage self, mlt_frame frame, mlt_image_format form
+ QString interps = mlt_properties_get( properties, "rescale.interp" );
+ bool interp = ( interps != "nearest" ) && ( interps != "none" );
+ QImage *qimage = static_cast<QImage*>( self->qimage );
++ int has_alpha = qimage->hasAlphaChannel();
++ QImage::Format qimageFormat = has_alpha ? QImage::Format_ARGB32 : QImage::Format_RGB32;
+
+ // Note - the original qimage is already safe and ready for destruction
+- if ( qimage->depth() == 1 )
++ if ( qimage->format() != qimageFormat )
+ {
+- QImage temp = qimage->convertToFormat( QImage::Format_RGB32 );
++ QImage temp = qimage->convertToFormat( qimageFormat );
+ delete qimage;
+ qimage = new QImage( temp );
+ self->qimage = qimage;
+ }
+ QImage scaled = interp? qimage->scaled( QSize( width, height ) ) :
+ qimage->scaled( QSize(width, height), Qt::IgnoreAspectRatio, Qt::SmoothTransformation );
+- int has_alpha = scaled.hasAlphaChannel();
+
+ // Store width and height
+ self->current_width = width;