Points: Fix several coverity issues:
* CID 350545: Resource leak * CID 350553: Resource leak * CID 350559: Resource leak * CID 350593: Resource leak * CID 350604: Resource leak * CID 350625: Resource leak * CID 350650: Resource leak * CID 129019: Division or modulo by float zero (false-positive) * CID 129020: Division or modulo by float zero (false-positive) * CID 129021: Division or modulo by float zero (false-positive)
This commit is contained in:
@@ -1330,15 +1330,15 @@ void E57Reader::read(const std::string& filename)
|
||||
e57::StructureNode prototype(cvn.prototype());
|
||||
// create buffers for the compressed vector reader
|
||||
const size_t buf_size = 1024;
|
||||
double* xyz = new double[buf_size * 3];
|
||||
double* intensity = new double[buf_size];
|
||||
int64_t* state = new int64_t[buf_size];
|
||||
unsigned* rgb = new unsigned[buf_size * 3];
|
||||
int64_t* nil = new int64_t[buf_size];
|
||||
double xyz[buf_size * 3];
|
||||
double intensity[buf_size];
|
||||
int64_t state[buf_size];
|
||||
unsigned rgb[buf_size * 3];
|
||||
int64_t nil[buf_size];
|
||||
|
||||
// check the channels which are needed
|
||||
unsigned* ptr_xyz = new unsigned[3];
|
||||
unsigned* ptr_rgb = new unsigned[3];
|
||||
unsigned ptr_xyz[3];
|
||||
unsigned ptr_rgb[3];
|
||||
bool inty = false;
|
||||
bool inv_state = false;
|
||||
unsigned cnt_xyz = 0;
|
||||
|
||||
@@ -147,17 +147,26 @@ void PointsGrid::InitGrid ()
|
||||
{
|
||||
// Offset fGridLen/2
|
||||
//
|
||||
_fGridLenX = (1.0f + fLengthX) / double(_ulCtGridsX);
|
||||
unsigned long num = _ulCtGridsX;
|
||||
if (num == 0)
|
||||
num = 1;
|
||||
_fGridLenX = (1.0f + fLengthX) / double(num);
|
||||
_fMinX = clBBPts.MinX - 0.5f;
|
||||
}
|
||||
|
||||
{
|
||||
_fGridLenY = (1.0f + fLengthY) / double(_ulCtGridsY);
|
||||
unsigned long num = _ulCtGridsY;
|
||||
if (num == 0)
|
||||
num = 1;
|
||||
_fGridLenY = (1.0f + fLengthY) / double(num);
|
||||
_fMinY = clBBPts.MinY - 0.5f;
|
||||
}
|
||||
|
||||
{
|
||||
_fGridLenZ = (1.0f + fLengthZ) / double(_ulCtGridsZ);
|
||||
unsigned long num = _ulCtGridsZ;
|
||||
if (num == 0)
|
||||
num = 1;
|
||||
_fGridLenZ = (1.0f + fLengthZ) / double(num);
|
||||
_fMinZ = clBBPts.MinZ - 0.5f;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user