From 5071bc6d73c22304b8b139d040a02eb3e1f33407 Mon Sep 17 00:00:00 2001 From: malaterre Date: Tue, 20 May 2008 09:22:03 +0000 Subject: [PATCH] BUG: backport from gdcm 1.2. Should not crash when jpeg was not instanciated --- src/gdcmPixelReadConvert.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gdcmPixelReadConvert.cxx b/src/gdcmPixelReadConvert.cxx index c54287df..45aaf812 100644 --- a/src/gdcmPixelReadConvert.cxx +++ b/src/gdcmPixelReadConvert.cxx @@ -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; } /** -- 2.45.0