qtbase: Fix reentrancy problem in image reading
authorByungseon Shin <sun.shin@lge.com>
Wed, 17 Apr 2013 00:54:27 +0000 (17:54 -0700)
committerPatrick Ohly <patrick.ohly@intel.com>
Fri, 9 Jan 2015 16:44:13 +0000 (08:44 -0800)
* Fix GF-2779, by applying Upstream patch QTBUG-29281.

(From meta-qt5 rev: 49fe70cda9cda9d73080751cb97a7719d04db056)

Signed-off-by: Byungseon Shin <sun.shin@lge.com>
Signed-off-by: Martin Jansa <martin.jansa@lge.com>
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
meta-qt5/recipes-qt/qt5/qtbase/0005-AddSynchoronization-qimagereader.patch [new file with mode: 0644]
meta-qt5/recipes-qt/qt5/qtbase_5.0.0.bb

diff --git a/meta-qt5/recipes-qt/qt5/qtbase/0005-AddSynchoronization-qimagereader.patch b/meta-qt5/recipes-qt/qt5/qtbase/0005-AddSynchoronization-qimagereader.patch
new file mode 100644 (file)
index 0000000..a16731a
--- /dev/null
@@ -0,0 +1,37 @@
+commit e28c03cb829c229209090d7939a9aba1af1fdea9
+Author: aavit <eirik.aavitsland@digia.com>
+Date:   Tue Feb 19 18:11:16 2013 +0100
+
+    Fix reentrancy problem in image reading
+    
+    There were race conditions when accessing the plugin factory and
+    the image reader plugins from different threads; ref QTBUG-29281.
+    Added a mutex lock to avoid.
+    
+    Change-Id: Ic1a3b6cbaf5603f1bcf7025b58247a9a3f6d08a9
+    Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
+
+Upstream-Status: Backport (from 5.1.0)
+
+diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp
+index 5eaf7bb..6847786 100644
+--- a/src/gui/image/qimagereader.cpp
++++ b/src/gui/image/qimagereader.cpp
+@@ -133,6 +133,7 @@
+ // factory loader
+ #include <qcoreapplication.h>
+ #include <private/qfactoryloader_p.h>
++#include <QMutexLocker>
+ // image handlers
+ #include <private/qbmphandler_p.h>
+@@ -232,6 +233,9 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
+     QByteArray suffix;
+ #ifndef QT_NO_IMAGEFORMATPLUGIN
++    static QMutex mutex;
++    QMutexLocker locker(&mutex);
++
+     typedef QMultiMap<int, QString> PluginKeyMap;
+     // check if we have plugins that support the image format
index 9a0d68b..a2a819e 100644 (file)
@@ -4,6 +4,7 @@ require qt5-${PV}.inc
 PR = "${INC_PR}.0"
 
 SRC_URI += "file://0004-Disable-mkv8snapshot.patch"
+SRC_URI += "file://0005-AddSynchoronization-qimagereader.patch"
 
 SRC_URI[md5sum] = "c29073bfc3cf6b39492a2481d982386e"
 SRC_URI[sha256sum] = "89bcde09b24e8139f9d1d957dcb07c5aada83d578c84279f66813f348243d500"