From d93338a830efe68b144589da58a0605bbd868f05 Mon Sep 17 00:00:00 2001
From: Julien Michel <julien.michel@orfeo-toolbox.org>
Date: Tue, 3 Feb 2015 11:26:22 +0100
Subject: [PATCH] COV: Fixing coverity issue 1221585 (Unchecked return value
 from library)

---
 Code/IO/otbMSTARImageIO.cxx | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/Code/IO/otbMSTARImageIO.cxx b/Code/IO/otbMSTARImageIO.cxx
index fef1f0c3f3..23932974cd 100644
--- a/Code/IO/otbMSTARImageIO.cxx
+++ b/Code/IO/otbMSTARImageIO.cxx
@@ -370,12 +370,18 @@ void MSTARImageIO::Read(void* buffer)
     {
     case CHIP_IMAGE:
       magloc  = phlen;
-      fseek(MSTARfp, magloc, 0);
+      if(fseek(MSTARfp, magloc, 0))
+        {
+        itkExceptionMacro(<<" Problem while reading file "<<MSTARname);
+        }
       nchunks = numrows * numcols;
       break;
     case FSCENE_IMAGE:
       magloc  = phlen + nhlen; /* nhlen = 512 */
-      fseek(MSTARfp, magloc, 0);
+      if(fseek(MSTARfp, magloc, 0))
+        {
+        itkExceptionMacro(<<" Problem while reading file "<<MSTARname);
+        }
       nchunks = numrows * numcols;
       break;
     }
-- 
GitLab