From 011922a24323661a2ec03e9de212c75b7919569e Mon Sep 17 00:00:00 2001
From: Aurelien Bricier <aurelien.bricier@c-s.fr>
Date: Fri, 23 Nov 2012 11:01:21 +0100
Subject: [PATCH] WRG: fixed warnings

---
 Applications/FeatureExtraction/otbEdgeExtraction.cxx           | 3 ++-
 Applications/FeatureExtraction/otbLocalStatisticExtraction.cxx | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Applications/FeatureExtraction/otbEdgeExtraction.cxx b/Applications/FeatureExtraction/otbEdgeExtraction.cxx
index 36900fbd7e..5f409d775c 100644
--- a/Applications/FeatureExtraction/otbEdgeExtraction.cxx
+++ b/Applications/FeatureExtraction/otbEdgeExtraction.cxx
@@ -130,8 +130,9 @@ void DoExecute()
 {
   FloatVectorImageType::Pointer inImage = GetParameterImage("in");
   inImage->UpdateOutputInformation();
+  int nbChan = inImage->GetNumberOfComponentsPerPixel();
 
-  if( GetParameterInt("channel") > inImage->GetNumberOfComponentsPerPixel() )
+  if( GetParameterInt("channel") > nbChan )
     {
     otbAppLogCRITICAL("Selected band is not available...");
     return;
diff --git a/Applications/FeatureExtraction/otbLocalStatisticExtraction.cxx b/Applications/FeatureExtraction/otbLocalStatisticExtraction.cxx
index 9488cc0fe8..457ca6fccb 100644
--- a/Applications/FeatureExtraction/otbLocalStatisticExtraction.cxx
+++ b/Applications/FeatureExtraction/otbLocalStatisticExtraction.cxx
@@ -102,8 +102,9 @@ void DoExecute()
 {
   FloatVectorImageType::Pointer inImage = GetParameterImage("in");
   inImage->UpdateOutputInformation();
+  int nbChan = inImage->GetNumberOfComponentsPerPixel();
 
-  if( GetParameterInt("channel") > inImage->GetNumberOfComponentsPerPixel() )
+  if( GetParameterInt("channel") > nbChan )
     {
     otbAppLogCRITICAL("Selected band is not available...");
     return;
-- 
GitLab