mirror of
https://github.com/minetest/irrlicht.git
synced 2024-12-25 07:32:25 +01:00
CB3DMeshFileLoader: abort if offsets point outside of file
Thanks @sfan5 for patch in Mintest: 195759100f
Forum: https://irrlicht.sourceforge.io/forum/viewtopic.php?f=2&t=52819&p=306518
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6353 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
parent
0317f678fb
commit
8fcc572845
@ -136,7 +136,8 @@ bool CB3DMeshFileLoader::load()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
os::Printer::log("Unknown chunk found in mesh base - skipping");
|
os::Printer::log("Unknown chunk found in mesh base - skipping");
|
||||||
B3DFile->seek(B3dStack.getLast().startposition + B3dStack.getLast().length);
|
if (!B3DFile->seek(B3dStack.getLast().startposition + B3dStack.getLast().length))
|
||||||
|
return false;
|
||||||
B3dStack.erase(B3dStack.size()-1);
|
B3dStack.erase(B3dStack.size()-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -232,7 +233,8 @@ bool CB3DMeshFileLoader::readChunkNODE(CSkinnedMesh::SJoint *inJoint)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
os::Printer::log("Unknown chunk found in node chunk - skipping");
|
os::Printer::log("Unknown chunk found in node chunk - skipping");
|
||||||
B3DFile->seek(B3dStack.getLast().startposition + B3dStack.getLast().length);
|
if (!B3DFile->seek(B3dStack.getLast().startposition + B3dStack.getLast().length))
|
||||||
|
return false;
|
||||||
B3dStack.erase(B3dStack.size()-1);
|
B3dStack.erase(B3dStack.size()-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -315,7 +317,8 @@ bool CB3DMeshFileLoader::readChunkMESH(CSkinnedMesh::SJoint *inJoint)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
os::Printer::log("Unknown chunk found in mesh - skipping");
|
os::Printer::log("Unknown chunk found in mesh - skipping");
|
||||||
B3DFile->seek(B3dStack.getLast().startposition + B3dStack.getLast().length);
|
if (!B3DFile->seek(B3dStack.getLast().startposition + B3dStack.getLast().length))
|
||||||
|
return false;
|
||||||
B3dStack.erase(B3dStack.size()-1);
|
B3dStack.erase(B3dStack.size()-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user