From 80903754bdf4bbcaa904095fe66001af84bc405c Mon Sep 17 00:00:00 2001 From: dataisland Date: Sun, 8 Sep 2024 11:03:14 -0500 Subject: [PATCH] Fix invalid access --- code/PostProcessing/SortByPTypeProcess.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/PostProcessing/SortByPTypeProcess.cpp b/code/PostProcessing/SortByPTypeProcess.cpp index 48ebbc573..3de1818ff 100644 --- a/code/PostProcessing/SortByPTypeProcess.cpp +++ b/code/PostProcessing/SortByPTypeProcess.cpp @@ -167,6 +167,10 @@ void SortByPTypeProcess::Execute(aiScene *pScene) { // with the largest number of primitives unsigned int aiNumPerPType[4] = { 0, 0, 0, 0 }; aiFace *pFirstFace = mesh->mFaces; + if (!pFirstFace) { + continue; + } + aiFace *const pLastFace = pFirstFace + mesh->mNumFaces; unsigned int numPolyVerts = 0;