Commit 57f8a0f3 authored by Ludovic Hussonnois's avatar Ludovic Hussonnois

WRG: Correct defects reported by Coverity Scan.

parent 35acbade
...@@ -84,7 +84,7 @@ public: ...@@ -84,7 +84,7 @@ public:
private: private:
Int32ImageType* m_Input; Int32ImageType* m_Input = ITK_SP_NULLPTR;
Int32ImageType::Pointer m_Reference; Int32ImageType::Pointer m_Reference;
RAMDrivenAdaptativeStreamingManagerType::Pointer m_StreamingManager; RAMDrivenAdaptativeStreamingManagerType::Pointer m_StreamingManager;
otb::ogr::DataSource::Pointer m_OgrRef; otb::ogr::DataSource::Pointer m_OgrRef;
......
...@@ -228,13 +228,13 @@ private: ...@@ -228,13 +228,13 @@ private:
typedef otb::ProfileDerivativeToMultiScaleCharacteristicsFilter<FloatImageType, FloatImageType, LabeledImageType> MultiScaleCharacteristicsFilterType; typedef otb::ProfileDerivativeToMultiScaleCharacteristicsFilter<FloatImageType, FloatImageType, LabeledImageType> MultiScaleCharacteristicsFilterType;
// Instantiation // Instantiation
typename OpeningProfileFilterType::Pointer oprofileFilter; typename OpeningProfileFilterType::Pointer oprofileFilter = OpeningProfileFilterType::New();
typename ClosingProfileFilterType::Pointer cprofileFilter; typename ClosingProfileFilterType::Pointer cprofileFilter = ClosingProfileFilterType::New();
typename DerivativeFilterType::Pointer oderivativeFilter; typename DerivativeFilterType::Pointer oderivativeFilter = DerivativeFilterType::New();
typename DerivativeFilterType::Pointer cderivativeFilter; typename DerivativeFilterType::Pointer cderivativeFilter = DerivativeFilterType::New();
typename MultiScaleCharacteristicsFilterType::Pointer omsCharFilter; typename MultiScaleCharacteristicsFilterType::Pointer omsCharFilter = MultiScaleCharacteristicsFilterType::New();
typename MultiScaleCharacteristicsFilterType::Pointer cmsCharFilter; typename MultiScaleCharacteristicsFilterType::Pointer cmsCharFilter = MultiScaleCharacteristicsFilterType::New();
typename MultiScaleClassificationFilterType::Pointer classificationFilter; typename MultiScaleClassificationFilterType::Pointer classificationFilter = MultiScaleClassificationFilterType::New();
bool classify = profile == "classification"; bool classify = profile == "classification";
bool opening = profile == "opening"; bool opening = profile == "opening";
...@@ -291,7 +291,6 @@ private: ...@@ -291,7 +291,6 @@ private:
typedef ImageList<FloatImageType> TImageList; typedef ImageList<FloatImageType> TImageList;
typedef otb::ImageListToVectorImageFilter<TImageList, FloatVectorImageType> TListToVectorImageFilter; typedef otb::ImageListToVectorImageFilter<TImageList, FloatVectorImageType> TListToVectorImageFilter;
profileFilter = TProfileFilter::New();
profileFilter->SetInput( m_ExtractorFilter->GetOutput() ); profileFilter->SetInput( m_ExtractorFilter->GetOutput() );
profileFilter->SetProfileSize( profileSize ); profileFilter->SetProfileSize( profileSize );
profileFilter->SetInitialValue( initValue ); profileFilter->SetInitialValue( initValue );
...@@ -307,7 +306,6 @@ private: ...@@ -307,7 +306,6 @@ private:
return; return;
} }
derivativeFilter = TDerivativeFilter::New();
derivativeFilter->SetInput( profileFilter->GetOutput() ); derivativeFilter->SetInput( profileFilter->GetOutput() );
if ( derivative ) if ( derivative )
...@@ -320,7 +318,6 @@ private: ...@@ -320,7 +318,6 @@ private:
return; return;
} }
msCharFilter = TCharacteristicsFilter::New();
msCharFilter->SetInput( derivativeFilter->GetOutput() ); msCharFilter->SetInput( derivativeFilter->GetOutput() );
msCharFilter->SetInitialValue( initValue ); msCharFilter->SetInitialValue( initValue );
msCharFilter->SetStep( step ); msCharFilter->SetStep( step );
......
...@@ -61,6 +61,8 @@ int otbContingencyTableCalculatorSetListSamples(int argc, char* argv[]) ...@@ -61,6 +61,8 @@ int otbContingencyTableCalculatorSetListSamples(int argc, char* argv[])
int nbSamples = atoi(argv[1]); int nbSamples = atoi(argv[1]);
int nbClasses = atoi(argv[2]); int nbClasses = atoi(argv[2]);
if( nbClasses <= 0 )
nbClasses = 1;
for (int i = 0; i < nbSamples; ++i) for (int i = 0; i < nbSamples; ++i)
{ {
......
...@@ -151,6 +151,7 @@ QtWidgetView ...@@ -151,6 +151,7 @@ QtWidgetView
setObjectName( QtWidgetView::OBJECT_NAME ); setObjectName( QtWidgetView::OBJECT_NAME );
m_Model = new otb::Wrapper::QtWidgetModel( otbApp ); m_Model = new otb::Wrapper::QtWidgetModel( otbApp );
m_QuitShortcut = new QShortcut(QKeySequence("Ctrl+Q"), this);
QObject::connect( QObject::connect(
m_Model, SIGNAL( SetProgressReportBegin() ), m_Model, SIGNAL( SetProgressReportBegin() ),
...@@ -303,7 +304,6 @@ QtWidgetView ...@@ -303,7 +304,6 @@ QtWidgetView
); );
// Add Ctrl-Q shortcut to quit // Add Ctrl-Q shortcut to quit
m_QuitShortcut = new QShortcut(QKeySequence("Ctrl+Q"), this);
connect( m_QuitShortcut, SIGNAL(activated()), this, SLOT(close()) ); connect( m_QuitShortcut, SIGNAL(activated()), this, SLOT(close()) );
......
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