From 6c2617874a138879a65a888ffe4067a35f332e72 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Mon, 21 Jul 2025 22:03:14 -0500 Subject: [PATCH] CAM: Fix multiplication result converted to larger type --- src/Mod/CAM/PathSimulator/App/VolSim.cpp | 2 +- src/Mod/CAM/PathSimulator/AppGL/TextureLoader.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Mod/CAM/PathSimulator/App/VolSim.cpp b/src/Mod/CAM/PathSimulator/App/VolSim.cpp index 2a6164e8d9..7a70749b6c 100644 --- a/src/Mod/CAM/PathSimulator/App/VolSim.cpp +++ b/src/Mod/CAM/PathSimulator/App/VolSim.cpp @@ -748,7 +748,7 @@ cSimTool::cSimTool(const TopoDS_Shape& toolShape, float res) for (int x = 0; x < radValue; x++) { // find the face of the tool by checking z points across the // radius to see if the point is inside the shape - pnt.x = x * res; + pnt.x = static_cast(x) * res; bool inside = isInside(toolShape, pnt, res); // move down until the point is outside the shape diff --git a/src/Mod/CAM/PathSimulator/AppGL/TextureLoader.cpp b/src/Mod/CAM/PathSimulator/AppGL/TextureLoader.cpp index 03f2f080c7..4c6aa63c1e 100644 --- a/src/Mod/CAM/PathSimulator/AppGL/TextureLoader.cpp +++ b/src/Mod/CAM/PathSimulator/AppGL/TextureLoader.cpp @@ -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(textureSize) * static_cast(textureSize) * sizeof(unsigned int); mRawData = (unsigned int*)malloc(buffsize); if (mRawData == nullptr) { return;