aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcutealien <cutealien@dfc29bdd-3216-0410-991c-e03cc46cb475>2022-05-13 14:56:22 +0000
committersfan5 <sfan5@live.de>2023-03-24 17:09:11 +0100
commit6a9e0f109c0be5529730d55d5b6d6862d4b78a24 (patch)
tree878af8eba2b65998f26f8c26916257db79e12a07
parent15e3f15b48073f4085f81b9a063b709c7872eab7 (diff)
downloadirrlicht-6a9e0f109c0be5529730d55d5b6d6862d4b78a24.tar.xz
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
-rw-r--r--source/Irrlicht/CB3DMeshWriter.cpp2
-rw-r--r--source/Irrlicht/CImage.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/source/Irrlicht/CB3DMeshWriter.cpp b/source/Irrlicht/CB3DMeshWriter.cpp
index ac68f77..3b5e49a 100644
--- a/source/Irrlicht/CB3DMeshWriter.cpp
+++ b/source/Irrlicht/CB3DMeshWriter.cpp
@@ -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);
}
diff --git a/source/Irrlicht/CImage.cpp b/source/Irrlicht/CImage.cpp
index fcbeacf..5d1e9fa 100644
--- a/source/Irrlicht/CImage.cpp
+++ b/source/Irrlicht/CImage.cpp
@@ -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