]> Creatis software - gdcm.git/commitdiff
FIX: valgrind reported this one:
authormalaterre <malaterre>
Wed, 28 Jul 2004 21:10:07 +0000 (21:10 +0000)
committermalaterre <malaterre>
Wed, 28 Jul 2004 21:10:07 +0000 (21:10 +0000)
UMR ==23598== Use of uninitialised value of size 4
==23598==    at 0x77C5B7: isalpha (in /lib/tls/libc-2.3.2.so)
==23598==    by 0x3C2CAB2E: gdcmDocument::FindDocEntryVR(gdcmDocEntry*) (gdcmDocument.cxx:1783)
==23598==    by 0x3C2CCE83: gdcmDocument::ReadNextDocEntry() (gdcmDocument.cxx:2556)
==23598==    by 0x3C2C985C: gdcmDocument::ParseSQ(gdcmSeqEntry*, long, long, bool) (gdcmDocument.cxx:1422)
==23598==    by 0x3C2C9792: gdcmDocument::ParseDES(gdcmDocEntrySet*, long, long, bool) (gdcmDocument.cxx:1391)
==23598==    by 0x3C2C5858: gdcmDocument::gdcmDocument(std::string const&, bool, bool, bool) (gdcmDocument.cxx:130)
==23598==    by 0x3C2B19FA: gdcmHeader::gdcmHeader(std::string const&, bool, bool, bool) (gdcmHeader.cxx:47)
==23598==    by 0x8053824: PrintAllDocument(int, char**) (PrintAllDocument.cxx:34)
==23598==    by 0x8050D3E: main (gdcmTests.cxx:173)
==23598==

src/gdcmDocument.cxx

index a13de9d0e014a32d8e9e08533f37730c50c0ee40..fae37a03f5c2435a1a72d5e28f301023f109e4bb 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/07/20 08:29:13 $
-  Version:   $Revision: 1.56 $
+  Date:      $Date: 2004/07/28 21:10:07 $
+  Version:   $Revision: 1.57 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -1777,7 +1777,7 @@ void gdcmDocument::FindDocEntryVR( gdcmDocEntry *entry )
    // is in explicit VR and try to fix things if it happens not to be
    // the case.
    
-   fread (&vr, (size_t)2,(size_t)1, Fp);
+   fread (vr, (size_t)2,(size_t)1, Fp);
    vr[2] = 0;
 
    if( !CheckDocEntryVR(entry, vr) )