diff options
author | sfan5 <sfan5@live.de> | 2022-01-15 16:05:01 +0100 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2022-01-15 16:06:30 +0100 |
commit | 195759100fc723f466b46938128eeaed3edc3a24 (patch) | |
tree | 19aa6c83f469fbb8ad615d2b53bb9a50b83fe93b /source/Irrlicht/CB3DMeshFileLoader.cpp | |
parent | 2fec5e5dd3067de3698c71f208eeccdcc10c9a63 (diff) | |
download | irrlicht-195759100fc723f466b46938128eeaed3edc3a24.tar.xz |
CB3DMeshFileLoader: abort if offsets point outside of file
fixes #70
Diffstat (limited to 'source/Irrlicht/CB3DMeshFileLoader.cpp')
-rw-r--r-- | source/Irrlicht/CB3DMeshFileLoader.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/Irrlicht/CB3DMeshFileLoader.cpp b/source/Irrlicht/CB3DMeshFileLoader.cpp index 41498ea..05f9f0f 100644 --- a/source/Irrlicht/CB3DMeshFileLoader.cpp +++ b/source/Irrlicht/CB3DMeshFileLoader.cpp @@ -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);
}
}
@@ -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);
}
}
@@ -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);
}
}
|