X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmRLE.cxx;h=52f9a9f23927feb731ed0785304df96e33c32936;hb=44fa5b50d1d1c766c12ada7b2ae2fdd8e38291db;hp=83a0c281cb64aed5ad86e53108c35a47f599666f;hpb=b9ab8805bd66e5fc6dc74788435df455899eb661;p=gdcm.git diff --git a/src/gdcmRLE.cxx b/src/gdcmRLE.cxx index 83a0c281..52f9a9f2 100644 --- a/src/gdcmRLE.cxx +++ b/src/gdcmRLE.cxx @@ -1,8 +1,24 @@ -// gdcmRLE.cxx -//----------------------------------------------------------------------------- +/*========================================================================= + + Program: gdcm + Module: $RCSfile: gdcmRLE.cxx,v $ + Language: C++ + Date: $Date: 2004/06/20 18:08:48 $ + Version: $Revision: 1.18 $ + + Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de + l'Image). All rights reserved. See Doc/License.txt or + http://www.creatis.insa-lyon.fr/Public/Gdcm/License.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + #include #include "gdcmFile.h" -#include // to declare isprint() +#include // For isprint() #define str2num(str, typeNum) *((typeNum *)(str)) @@ -41,7 +57,7 @@ bool gdcmFile::gdcm_read_RLE_file (FILE *fp,void * image_buffer) { ln=Header->SwapLong(ln); // Basic Offset Table Item Lentgh if (ln != 0) { // What is it used for ?? - char * BasicOffsetTableItemValue= (char *)malloc(ln+1); + char * BasicOffsetTableItemValue= new char[ln+1]; fread(BasicOffsetTableItemValue,ln,1,fp); guint32 a; for (int i=0;iGetXSize()*Header->GetYSize(); int nbFrames = Header->GetZSize(); - char * newDest = (char*) malloc(l*nbFrames*2); + char * newDest = new char[l*nbFrames*2]; char *x = newDest; char * a = (char *)image_buffer; char * b = a + l; @@ -126,7 +142,7 @@ bool gdcmFile::gdcm_read_RLE_file (FILE *fp,void * image_buffer) { } } memmove(image_buffer,newDest,lgrTotale); - free(newDest); + delete[] newDest; } return(true);