Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
CB3DMeshFileLoader: abort if offsets point outside of file
Browse files Browse the repository at this point in the history
fixes #70
  • Loading branch information
sfan5 committed Jan 15, 2022
1 parent 2fec5e5 commit 1957591
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions source/Irrlicht/CB3DMeshFileLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ bool CB3DMeshFileLoader::load()
else
{
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);
}
}
Expand Down Expand Up @@ -226,7 +227,8 @@ bool CB3DMeshFileLoader::readChunkNODE(CSkinnedMesh::SJoint *inJoint)
else
{
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);
}
}
Expand Down Expand Up @@ -308,7 +310,8 @@ bool CB3DMeshFileLoader::readChunkMESH(CSkinnedMesh::SJoint *inJoint)
else
{
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);
}
}
Expand Down

0 comments on commit 1957591

Please sign in to comment.