Commit 53978c44 authored by Julien Michel's avatar Julien Michel

COV: Fixing coverities medium issues for OssimPlugins

parent 84c18b8b
......@@ -160,7 +160,7 @@ RadiometricData& RadiometricData::operator=(const RadiometricData& rhs)
_n_data = rhs._n_data;
_field_size = _field_size;
_field_size = rhs._field_size;
_chan_ind = rhs._chan_ind;
......
......@@ -69,7 +69,14 @@ namespace ossimplugins
_imageFilename(rhs._imageFilename),
_productXmlFile(rhs._productXmlFile)
{
_sarSensor = new SarSensor(_sensor,_platformPosition);
if(_sensor && _platformPosition)
{
_sarSensor = new SarSensor(_sensor,_platformPosition);
}
else
{
_sarSensor = NULL;
}
}
ossimGeometricSarSensorModel::~ossimGeometricSarSensorModel()
......@@ -248,14 +255,17 @@ namespace ossimplugins
++itEstimatedCoords;
}
xErrorMean /= nbPoints ;
yErrorMean /= nbPoints ;
xActualMean /= nbPoints ;
yActualMean /= nbPoints ;
xActualPow /= nbPoints ;
yActualPow /= nbPoints ;
xErrorByActualMean /= nbPoints ;
yErrorByActualMean /= nbPoints ;
if(nbPoints>0)
{
xErrorMean /= nbPoints ;
yErrorMean /= nbPoints ;
xActualMean /= nbPoints ;
yActualMean /= nbPoints ;
xActualPow /= nbPoints ;
yActualPow /= nbPoints ;
xErrorByActualMean /= nbPoints ;
yErrorByActualMean /= nbPoints ;
}
// linear regression
if (fabs(xActualPow - xActualMean*xActualMean) > FLT_EPSILON)
......
......@@ -205,7 +205,11 @@ bool ossimRadarSat2Model::open(const ossimFilename& file)
}
// Set the base class gsd:
if(result)
{
result = rsDoc.initGsd(xdoc, theGSD);
}
if (result)
{
theMeanGSD = (theGSD.x + theGSD.y)/2.0;
......@@ -462,7 +466,7 @@ bool ossimRadarSat2Model::InitPlatformPosition(const ossimKeywordlist &kwl, cons
if (! ossim::iso8601TimeStringToCivilDate(utcString, eph_civil_date))
{
delete ephemeris;
delete [] ephemeris;
return false;
}
......
......@@ -204,7 +204,11 @@ bool ossimRadarSat2RPCModel::open(const ossimFilename& file)
}
// Set the base class gsd:
result = rsDoc.initGsd(xdoc, theGSD);
if(result)
{
result = rsDoc.initGsd(xdoc, theGSD);
}
if (result)
{
theMeanGSD = (theGSD.x + theGSD.y)/2.0;
......
......@@ -86,7 +86,7 @@ HermiteInterpolator::HermiteInterpolator(int nbrPoints, double* x, double* y, do
*/
// if (theXValues[i] <= theXValues[i-1])
// std::cerr << "WARNING: Hermite interpolation assumes increasing x values" << std::endl;
assert(theXValues[i] > theXValues[i-1]);
assert(theXValues && theXValues[i] > theXValues[i-1]);
}
}
......
......@@ -252,7 +252,6 @@ bool SensorParams::loadState(const ossimKeywordlist& kwl, const char* prefix)
{
result = false;
}
return result;
lookup = kwl.find(pfx.c_str(), DOPCENLINEAR_KW);
if (lookup)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment