From 75a7803826f63fcbcbe3b1b8ce198e96c38b9920 Mon Sep 17 00:00:00 2001 From: jpr Date: Wed, 25 May 2005 12:54:17 +0000 Subject: [PATCH] Should avoid some memory leaks --- src/gdcmDocument.cxx | 11 ++++++++--- src/gdcmFileHelper.cxx | 7 ++++--- src/gdcmPixelReadConvert.cxx | 13 +++++++++++-- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index 778e9a38..95b8efec 100644 --- a/src/gdcmDocument.cxx +++ b/src/gdcmDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.cxx,v $ Language: C++ - Date: $Date: 2005/05/18 10:12:07 $ - Version: $Revision: 1.240 $ + Date: $Date: 2005/05/25 12:54:17 $ + Version: $Revision: 1.241 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -84,7 +84,12 @@ Document::Document( std::string const &fileName ) // Load will set it to true if sucessfull IsDocumentAlreadyLoaded = false; - Load(fileName); + Load(fileName); + + // Normaly (?) Fp should be already deleted by CloseFile() + if ( Fp != 0 ) + delete Fp; + Fp = 0; } /** * \brief Canonical destructor. diff --git a/src/gdcmFileHelper.cxx b/src/gdcmFileHelper.cxx index bc56a312..24cea256 100644 --- a/src/gdcmFileHelper.cxx +++ b/src/gdcmFileHelper.cxx @@ -4,8 +4,8 @@ Module: $RCSfile: gdcmFileHelper.cxx,v $ Language: C++ - Date: $Date: 2005/05/20 08:27:55 $ - Version: $Revision: 1.40 $ + Date: $Date: 2005/05/25 12:54:17 $ + Version: $Revision: 1.41 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -238,7 +238,7 @@ bool FileHelper::SetBinEntry(uint8_t *content, int lgth, ValEntry *FileHelper::InsertValEntry(std::string const &content, uint16_t group, uint16_t elem) { - return FileInternal->InsertValEntry(content,group,elem); + return FileInternal->InsertValEntry(content, group, elem); } /** @@ -1411,6 +1411,7 @@ void FileHelper::RestoreWriteMandatory() Archive->Restore(0x0002,0x0001); Archive->Restore(0x0002,0x0002); Archive->Restore(0x0002,0x0003); + Archive->Restore(0x0002,0x0010); Archive->Restore(0x0002,0x0012); Archive->Restore(0x0002,0x0013); Archive->Restore(0x0002,0x0016); diff --git a/src/gdcmPixelReadConvert.cxx b/src/gdcmPixelReadConvert.cxx index d2abc9e1..98270684 100644 --- a/src/gdcmPixelReadConvert.cxx +++ b/src/gdcmPixelReadConvert.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmPixelReadConvert.cxx,v $ Language: C++ - Date: $Date: 2005/05/23 13:28:19 $ - Version: $Revision: 1.59 $ + Date: $Date: 2005/05/25 12:54:18 $ + Version: $Revision: 1.60 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -405,6 +405,15 @@ bool PixelReadConvert::ReadAndDecompressJPEGFile( std::ifstream *fp ) if ( IsJPEGLS ) { + // WARNING : JPEG-LS is NOT the 'classical' Jpeg Lossless : + // [JPEG-LS is the basis for new lossless/near-lossless compression + // standard for continuous-tone images intended for JPEG2000. The standard + // is based on the LOCO-I algorithm (LOw COmplexity LOssless COmpression + // for Images) developed at Hewlett-Packard Laboratories] + // + // see http://datacompression.info/JPEGLS.shtml + // + gdcmWarningMacro( "Sorry, JPEG-LS not yet taken into account" ); fp->seekg( JPEGInfo->GetFirstFragment()->GetOffset(), std::ios::beg); // if ( ! gdcm_read_JPEGLS_file( fp,Raw ) ) -- 2.46.1