CAM: Fix multiplication result converted to larger type
This commit is contained in:
@@ -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<double>(x) * res;
|
||||
bool inside = isInside(toolShape, pnt, res);
|
||||
|
||||
// move down until the point is outside the shape
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user