From c1968823adfb8c997f98671becca51fc54614da7 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Thu, 20 Jan 2022 10:25:52 +0100 Subject: [PATCH] ASE: Fix material parsing - Fuzzer error found when material access get's an out-of-bound access. - Break parsing when material index gets out of range. - closes https://github.com/assimp/assimp/issues/4232 --- code/AssetLib/ASE/ASEParser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/AssetLib/ASE/ASEParser.cpp b/code/AssetLib/ASE/ASEParser.cpp index 4e381a8e0..f684b56d3 100644 --- a/code/AssetLib/ASE/ASEParser.cpp +++ b/code/AssetLib/ASE/ASEParser.cpp @@ -486,8 +486,9 @@ void Parser::ParseLV1MaterialListBlock() { ParseLV4MeshLong(iIndex); if (iIndex >= iMaterialCount) { - LogWarning("Out of range: material index is too large"); + LogError("Out of range: material index is too large"); iIndex = iMaterialCount - 1; + return; } // get a reference to the material