]> Creatis software - gdcm.git/commitdiff
BUG: backport from gdcm 1.2. Should not crash when jpeg was not instanciated
authormalaterre <malaterre>
Tue, 20 May 2008 09:22:03 +0000 (09:22 +0000)
committermalaterre <malaterre>
Tue, 20 May 2008 09:22:03 +0000 (09:22 +0000)
src/gdcmPixelReadConvert.cxx

index c54287df626a4a6d147dbb79c7c3941cbf6af291..45aaf812dd75df17a02bc981bebf4232b6f29c06 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmPixelReadConvert.cxx,v $
   Language:  C++
-  Date:      $Date: 2007/10/26 16:06:57 $
-  Version:   $Revision: 1.127 $
+  Date:      $Date: 2008/05/20 09:22:03 $
+  Version:   $Revision: 1.128 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -679,7 +679,7 @@ bool PixelReadConvert::ReadAndDecompressJPEGFile( std::ifstream *fp )
 //    if ( ! gdcm_read_JPEGLS_file( fp,Raw ) )
          return false;
    }
-   else
+   else if( JPEGInfo )
    {
      // make sure this is the right JPEG compression
      assert( !IsJPEGLS || !IsJPEG2000 );
@@ -696,6 +696,8 @@ bool PixelReadConvert::ReadAndDecompressJPEGFile( std::ifstream *fp )
      JPEGInfo->DecompressFromFile(fp, Raw, dummy, numberBytes, length );
      return true;
    }
+   //else (not sure how get there...), must be one of those crazy DICOM file
+   return false;
 }
 
 /**