From e1ffd4c059b41b2b1aae3ad6c44e23714ecacfd6 Mon Sep 17 00:00:00 2001 From: jpr Date: Mon, 29 Mar 2004 14:18:30 +0000 Subject: [PATCH] FIX : gdcmObject::ResetBoundaries now stops properly when end-of-list is reached --- src/gdcmObject.cxx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/gdcmObject.cxx b/src/gdcmObject.cxx index 72b41f23..f9a47606 100644 --- a/src/gdcmObject.cxx +++ b/src/gdcmObject.cxx @@ -92,19 +92,23 @@ std::string gdcmObject::GetEntryByName(TagName name) { * @param flag = 0 when META to be dealt with */ void gdcmObject::ResetBoundaries(int flag) { - + if (flag) { // it's NOT a META // upwards to fffe,e000 - for( i=j=debut(); - ((*i)->GetGroup() != 0xfffe) && ((*i)->GetElement() != 0x0000); - --i,j--) { - } + for( i=j=debut(); + ((*i)->GetGroup() != 0xfffe) && ((*i)->GetElement() != 0xe000); + --i,j--) { + } beginObj=j; } - // downwards to fffe,e000 + // upwards again to fffe,e000 + if (fin()== (--(plistEntries->end())) ) // Don't try anything more when end + return; // of Chained List is reached + + for( i=j=fin(); - ((*i)->GetGroup() != 0xfffe) && ((*i)->GetElement() != 0x0000); + ((*i)->GetGroup() != 0xfffe) && ((*i)->GetElement() != 0xe000); --i,j--) { } j--; -- 2.48.1