]> Creatis software - gdcm.git/commitdiff
We don't SetLoadMode(NO_SEQ | NO_SHADOW),
authorjpr <jpr>
Fri, 3 Jun 2005 15:40:53 +0000 (15:40 +0000)
committerjpr <jpr>
Fri, 3 Jun 2005 15:40:53 +0000 (15:40 +0000)
to avoid seg faults when a private group has a wrong value length

Example/MakeDicomDir.cxx

index 5cf73764724fa4490e850ab7c8545068d14b79b0..0be2432f2f0cfe0337a1f681ddc29fe26a4f8ed8 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: MakeDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/04/14 15:15:15 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2005/06/03 15:40:53 $
+  Version:   $Revision: 1.3 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -46,7 +46,7 @@ void EndMethod(void *toto) {
 
 int main(int argc, char *argv[]) 
 {
-   //gdcm::Debug::DebugOn();
+  // gdcm::Debug::DebugOn();
    std::string dirName;   
 
    if (argc > 1)
@@ -67,7 +67,10 @@ int main(int argc, char *argv[])
    // new style (user is allowed no to load Sequences an/or Shadow Groups)
    dcmdir = new gdcm::DicomDir( );
    dcmdir->SetParseDir(true);
-   dcmdir->SetLoadMode(NO_SEQ | NO_SHADOW);
+// some images have a wrong length for element 0x0000 of private groups
+//   dcmdir->SetLoadMode(NO_SEQ | NO_SHADOW);
+
+   dcmdir->SetLoadMode(NO_SEQ);
    dcmdir->Load(dirName);
 
    dcmdir->SetStartMethod(StartMethod, (void *) NULL);