CAM: Fix multiplication result converted to larger type

This commit is contained in:
Chris Hennes
2025-07-21 22:03:14 -05:00
parent 35122b0e92
commit 764542078f
2 changed files with 3 additions and 2 deletions

View File

@@ -55,7 +55,8 @@ TextureLoader::TextureLoader(std::string imgFolder,
int textureSize)
: mImageFolder(imgFolder)
{
int buffsize = textureSize * textureSize * sizeof(unsigned int);
size_t buffsize =
static_cast<size_t>(textureSize) * static_cast<size_t>(textureSize) * sizeof(unsigned int);
mRawData = (unsigned int*)malloc(buffsize);
if (mRawData == nullptr) {
return;