From f86b076f379e616d58c270d48e3730bf9c128338 Mon Sep 17 00:00:00 2001
From: Julien Michel <julien.michel@orfeo-toolbox.org>
Date: Fri, 22 Jun 2012 17:10:55 +0200
Subject: [PATCH] BUG: Fixing a segmentation fault in case a null feature is
 encountered

---
 Code/Testing/otbTestHelper.cxx | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Code/Testing/otbTestHelper.cxx b/Code/Testing/otbTestHelper.cxx
index 790ed365b4..f4986230e2 100644
--- a/Code/Testing/otbTestHelper.cxx
+++ b/Code/Testing/otbTestHelper.cxx
@@ -1238,6 +1238,12 @@ void TestHelper::DumpOGRFeature(FILE* fpOut, OGRFeature* feature, char** papszOp
 {
   if (fpOut == NULL) fpOut = stdout;
 
+  if(!feature)
+    {
+    fprintf(fpOut, "NULL feature encountered\n");
+    return;
+    }
+
   fprintf(fpOut, "OGRFeature:%ld\n", feature->GetFID());
 
   const char* pszDisplayFields =
-- 
GitLab