mirror of
https://github.com/minetest/irrlicht.git
synced 2024-11-10 01:33:51 +01:00
Avoid potential number overflows.
Found by VS code analyser git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6393 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
parent
15e3f15b48
commit
6a9e0f109c
@ -94,7 +94,7 @@ bool CB3DMeshWriter::writeMesh(io::IWriteFile* file, IMesh* const mesh, s32 flag
|
||||
u32 numTexture = texs.size();
|
||||
for (u32 i = 0; i < numTexture; i++)
|
||||
{
|
||||
file->write(texs[i].TextureName.c_str(), texs[i].TextureName.size() + 1);
|
||||
file->write(texs[i].TextureName.c_str(), (size_t)texs[i].TextureName.size() + 1);
|
||||
file->write(&texs[i].Flags, 7*4);
|
||||
}
|
||||
|
||||
|
@ -194,7 +194,7 @@ void CImage::copyToScaling(void* target, u32 width, u32 height, ECOLOR_FORMAT fo
|
||||
{
|
||||
if (pitch==Pitch)
|
||||
{
|
||||
memcpy(target, Data, height*pitch);
|
||||
memcpy(target, Data, (size_t)height*pitch);
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user