COBJMeshFileLoader: Avoid memory leak when handling files with invalid vertex indices

Thanks @sfan5 for report and patch
Was part of the Minetest commit 80e1609 patch which was applied earlier
(couldn't apply this with the rest as the rest could be fixed in Irrlicht 1.8, while this one is about new Irrlicht 1.9 code)


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6548 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien 2023-10-02 21:49:08 +00:00
parent 5a6e8c9d65
commit 7fd0f2b1fb

@ -255,6 +255,7 @@ IAnimatedMesh* COBJMeshFileLoader::createMesh(io::IReadFile* file)
{
os::Printer::log("Invalid vertex index in this line", wordBuffer.c_str(), ELL_ERROR);
delete [] buf;
cleanUp();
return 0;
}
if ( Idx[1] >= 0 && Idx[1] < (irr::s32)textureCoordBuffer.size() )