File 0001-assimp-Fix-out-of-bound-access.patch of Package libqt5-qt3d.35255

From 614911bb3b1bfc3a1799ae2b3cca306270f3fb97 Mon Sep 17 00:00:00 2001
From: Kim Kulling <kim.kulling@googlemail.com>
Date: Wed, 3 Jul 2024 21:05:53 +0200
Subject: [PATCH] Fix out of bound access

---
 code/AssetLib/Ply/PlyLoader.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/3rdparty/assimp/code/PlyLoader.cpp b/src/3rdparty/assimp/code/PlyLoader.cpp
index 3e92339fb4..0c2463f240 100644
--- a/src/3rdparty/assimp/code/PlyLoader.cpp
+++ b/src/3rdparty/assimp/code/PlyLoader.cpp
@@ -618,6 +618,10 @@ void PLYImporter::LoadFace(const PLY::Element *pcElement, const PLY::ElementInst
     {
       mGeneratedMesh->mNumFaces = pcElement->NumOccur;
       mGeneratedMesh->mFaces = new aiFace[mGeneratedMesh->mNumFaces];
+    } else {
+        if (mGeneratedMesh->mNumFaces < pcElement->NumOccur) {
+            throw DeadlyImportError("Invalid .ply file: Too many faces");
+        }
     }
 
     if (!bIsTriStrip)
openSUSE Build Service is sponsored by