From 45c6170b50fd76d5b81feb7ca17a0e30e8342dd8 Mon Sep 17 00:00:00 2001 From: malaterre Date: Fri, 12 May 2006 19:09:55 +0000 Subject: [PATCH] BUG: resultPath could be empty, cannot access char -1 in an array --- src/gdcmDictSet.cxx | 6 +++--- src/gdcmFile.h | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/gdcmDictSet.cxx b/src/gdcmDictSet.cxx index 6011c451..218acc65 100644 --- a/src/gdcmDictSet.cxx +++ b/src/gdcmDictSet.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDictSet.cxx,v $ Language: C++ - Date: $Date: 2006/05/11 15:23:07 $ - Version: $Revision: 1.76 $ + Date: $Date: 2006/05/12 19:09:55 $ + Version: $Revision: 1.77 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -142,7 +142,7 @@ std::string DictSet::BuildDictPath() { resultPath = PUB_DICT_PATH; } - if ( resultPath[resultPath.length()-1] != '/' ) + if ( resultPath.length() && resultPath[resultPath.length()-1] != '/' ) { resultPath += '/'; } diff --git a/src/gdcmFile.h b/src/gdcmFile.h index b3bb6aec..0eae98f2 100644 --- a/src/gdcmFile.h +++ b/src/gdcmFile.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFile.h,v $ Language: C++ - Date: $Date: 2006/05/11 19:49:38 $ - Version: $Revision: 1.126 $ + Date: $Date: 2006/05/12 19:09:55 $ + Version: $Revision: 1.127 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -105,14 +105,14 @@ public: // Loading GDCM_LEGACY(bool Load( std::string const &filename )) - bool Load(); + bool Load(); // Standard values and informations contained in the header bool IsReadable(); - + void SetFourthDimensionLocation(uint16_t group, uint16_t elem) { FourthDimensionLocation = TagKey(group, elem); } - // Some heuristic based accessors, end user intended + // Some heuristic based accessors, end user intended int GetImageNumber(); ModalityType GetModality(); @@ -120,7 +120,7 @@ public: int GetYSize(); int GetZSize(); int GetTSize(); // unnormalized in DICOM V3 - + float GetXSpacing(); float GetYSpacing(); float GetZSpacing(); -- 2.48.1