1
0

Merging r6256 through r6273 from trunk to ogl-es branch

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@6274 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien
2021-12-12 14:06:53 +00:00
parent 6025242ee9
commit 6d96663c9a
8 changed files with 31 additions and 13 deletions

View File

@@ -151,6 +151,13 @@ bool CMD2MeshFileLoader::loadFile(io::IReadFile* file, CAnimatedMeshMD2* mesh)
return false;
}
const int MAX_FRAME_SIZE = MD2_MAX_VERTS*4+128;
if ( header.frameSize > MAX_FRAME_SIZE )
{
os::Printer::log("MD2 Loader: Invalid large frame size in header", file->getFileName(), ELL_WARNING);
return false;
}
//
// prepare mesh and allocate memory
//
@@ -232,7 +239,7 @@ bool CMD2MeshFileLoader::loadFile(io::IReadFile* file, CAnimatedMeshMD2* mesh)
// read Vertices
u8 buffer[MD2_MAX_VERTS*4+128];
u8 buffer[MAX_FRAME_SIZE];
SMD2Frame* frame = (SMD2Frame*)buffer;
file->seek(header.offsetFrames);