git » qt5-quick3d.git » commit 2103810

Fix crash in QML designer if assimp is not installed

author Antonio Rojas
2021-01-23 16:53:05 UTC
committer Antonio Rojas
2021-01-23 16:53:05 UTC
parent 58775a1111dd5c3c999a23dc1057b7689d9839ff

Fix crash in QML designer if assimp is not installed

PKGBUILD +6 -3
qtbug-90564.patch +21 -0

diff --git a/PKGBUILD b/PKGBUILD
index 7c05fa3..df71582 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
 pkgname=qt5-quick3d
 _qtver=5.15.2
 pkgver=${_qtver/-/}
-pkgrel=1
+pkgrel=2
 arch=('x86_64')
 url='https://www.qt.io'
 license=('GPL3' 'LGPL3' 'FDL' 'custom')
@@ -15,15 +15,18 @@ optdepends=('assimp: Import from assimp')
 groups=('qt' 'qt5')
 _pkgfqn="${pkgname/5-/}-everywhere-src-${_qtver}"
 source=("https://download.qt.io/official_releases/qt/${pkgver%.*}/${_qtver}/submodules/${_pkgfqn}.tar.xz"
-         qtquick3d-assimp.patch)
+         qtquick3d-assimp.patch
+         qtbug-90564.patch)
 sha256sums=('5b0546323365ce34e4716f22f305ebb4902e222c1a0910b65ee448443c2f94bb'
-            '531c479880b51a0e5247ccba1b5158b99d16d2a8d4d63b462572687bef1862ef')
+            '531c479880b51a0e5247ccba1b5158b99d16d2a8d4d63b462572687bef1862ef'
+            '7301fbdd7d4d5fbcbb1f5e2567ae231d2fc1682a0f0620589930946c49535c10')
 
 prepare() {
   mkdir -p build
 
   cd $_pkgfqn
   patch -p1 -i ../qtquick3d-assimp.patch # Fix build with system assimp
+  patch -p1 -i ../qtbug-90564.patch # Fix crash in QML designer if assimp is not installed
 }
 
 build() {
diff --git a/qtbug-90564.patch b/qtbug-90564.patch
new file mode 100644
index 0000000..965788d
--- /dev/null
+++ b/qtbug-90564.patch
@@ -0,0 +1,21 @@
+diff --git a/src/assetimport/qssgassetimportmanager.cpp b/src/assetimport/qssgassetimportmanager.cpp
+index aec55978..15529f28 100644
+--- a/src/assetimport/qssgassetimportmanager.cpp
++++ b/src/assetimport/qssgassetimportmanager.cpp
+@@ -43,10 +43,12 @@ QSSGAssetImportManager::QSSGAssetImportManager(QObject *parent) : QObject(parent
+     const QStringList keys = QSSGAssetImporterFactory::keys();
+     for (const auto &key : keys) {
+         auto importer = QSSGAssetImporterFactory::create(key, QStringList());
+-        m_assetImporters.append(importer);
+-        // Add to extension map
+-        for (const auto &extension : importer->inputExtensions()) {
+-            m_extensionsMap.insert(extension, importer);
++        if (importer) {
++            m_assetImporters.append(importer);
++            // Add to extension map
++            for (const auto &extension : importer->inputExtensions()) {
++                m_extensionsMap.insert(extension, importer);
++            }
+         }
+     }
+ }