]> Creatis software - bbtk.git/commitdiff
#3494 bug vtkMetaImageReader box
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 6 Jan 2023 16:05:41 +0000 (17:05 +0100)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 6 Jan 2023 16:05:41 +0000 (17:05 +0100)
packages/vtk/src/bbvtkMetaImageReader.cxx

index d359bd3e1fb551cf73220f751b0c7346572e5174..f1453ecb7be3ac09941916db6994b5691f25dd50 100644 (file)
@@ -42,12 +42,12 @@ void MetaImageReader::Process()
 
     if (bbGetInputIn().length()!=0)
     {
-        if (bbGetInputIn().substr(bbGetInputIn().size()-5) == ".mhdb")
+        if ( (bbGetInputIn().size()>5) && (bbGetInputIn().substr(bbGetInputIn().size()-5)) == ".mhdb")
         {
             Read_mhdb( bbGetInputIn() );
         } else {
             FILE *ff = fopen( bbGetInputIn().c_str() , "r" );
-            if (ff)
+            if (ff!=NULL)
             {
                 fclose(ff);
                 vtkMetaImageReader *reader = vtkMetaImageReader::New();