diff --git a/Code/IO/otbMSTARImageIO.cxx b/Code/IO/otbMSTARImageIO.cxx index fef1f0c3f3e6189e229b13fc38f30d6bc1e4f7cb..23932974cd09cb7bd5e52ad77e4ad513a85ff139 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; }