Skip to content
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

Fix reading partial objects #27

Open
wants to merge 2 commits 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions dcmdata/libsrc/dcfilefo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,8 @@ OFCondition DcmFileFormat::readUntilTag(DcmInputStream &inStream,
{
// do read meta header not in given transfer syntax (always Little Endian Explicit)
errorFlag = metaInfo->read(inStream, EXS_Unknown, glenc, maxReadLength);
if (errorFlag.bad())
return errorFlag;
}

// determine xfer from tag (0002,0010) in the meta header
Expand Down
6 changes: 4 additions & 2 deletions dcmdata/libsrc/dcmetinf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,8 @@ OFCondition DcmMetaInfo::read(DcmInputStream &inStream,
errorFlag = EC_IllegalCall;
else
{
Xfer = xfer;
if (getTransferState() == ERW_init)
Xfer = xfer;
E_TransferSyntax newxfer = xfer;
// figure out if the stream reported an error
errorFlag = inStream.status();
Expand All @@ -429,7 +430,8 @@ OFCondition DcmMetaInfo::read(DcmInputStream &inStream,
fStartPosition = inStream.tell();
setLengthField(0);
}
}
} else
newxfer = Xfer; // use stored transfer syntax which was determined from preamble
if (getTransferState() == ERW_inWork && getLengthField() == 0)
{
if (inStream.avail() < OFstatic_cast(offile_off_t, DCM_GroupLengthElementLength))
Expand Down