Skip to content

Commit ad32c84

Browse files
committed
Add a fix for undefined length SQ in implicit
1 parent 973ea6d commit ad32c84

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Source/MediaStorageAndFileFormat/gdcmCleaner.cxx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -711,13 +711,15 @@ static VR ComputeDictVR(File &file, DataSet &ds, DataElement const &de) {
711711
}
712712
if (dict_vr != VR::SQ) {
713713
if (de.GetVL().IsUndefined()) {
714-
const Tag pixelData(0x7fe0, 0x0010);
715-
gdcm_assert(dict_vr == VR::OB
716-
/* old version of GDCM used to do that: */
717-
|| dict_vr == VR::OW);
718-
if (tag != pixelData) {
719-
gdcmErrorMacro("Impossible happen: " << de);
720-
return VR::SQ;
714+
if (dict_vr == VR::UN) {
715+
// implicit dataset, where SQ is undefined length
716+
} else {
717+
const Tag pixelData(0x7fe0, 0x0010);
718+
gdcm_assert(dict_vr == VR::OB);
719+
if (tag != pixelData) {
720+
gdcmErrorMacro("Impossible happen: " << de);
721+
return VR::SQ;
722+
}
721723
}
722724
}
723725
}

0 commit comments

Comments
 (0)