Skip to content

handle case when there is no sequence delim but null's #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions dcmdata/libsrc/dcpixseq.cc
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ OFCondition DcmPixelSequence::makeSubObject(DcmObject *&subObject,
l_error = EC_InvalidTag;
break;

case EVR_UL: //newTag (0x0000, 0x0000) has VR:UL
if (newTag == DCM_GenericGroupLength)
l_error = EC_ItemEnd;
break;

default:
newObject = new DcmPixelItem(newTag, newLength);
l_error = EC_CorruptedData;
Expand Down
5 changes: 5 additions & 0 deletions dcmdata/libsrc/dcsequen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,11 @@ OFCondition DcmSequenceOfItems::readSubItem(DcmInputStream &inStream,
<< DCM_ItemDelimitationItem << " by sequence delimiter "
<< DCM_SequenceDelimitationItem << " because it is expected here");
l_error = EC_SequEnd;
} else if (dcmReplaceWrongDelimitationItem.get() && (l_error == EC_CorruptedData)) {
DCMDATA_DEBUG("DcmSequenceOfItems::readSubItem() replacing null bytes "
<< DCM_GenericGroupLength << " by sequence delimiter "
<< DCM_SequenceDelimitationItem << " because it is expected here");
l_error = EC_SequEnd;
} else {
DCMDATA_DEBUG("DcmSequenceOfItems::readSubItem() cannot create Sub Item " << newTag);
// treat this incorrect encoding as an error
Expand Down