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

allow gaps in presentation context config #95

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
14 changes: 8 additions & 6 deletions dcmnet/libsrc/dcasccff.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ OFCondition DcmAssociationConfigurationFile::parsePresentationContexts(

char buf[64];
unsigned int counter;
OFBool found;
const char *key = NULL;
const char *value = NULL;
OFString abstractSyntaxUID;
OFString transferSyntaxKey;
size_t separator = 0;
size_t i;
size_t len;
size_t max_state_count = 512;
unsigned char c;
OFCondition result = EC_Normal;

Expand All @@ -157,8 +157,8 @@ OFCondition DcmAssociationConfigurationFile::parsePresentationContexts(
{
key = config.get_keyword(1);
counter = 0;
found = OFTrue;
while (found)

while (counter < max_state_count)
{
sprintf(buf, "%s%u", L0_PRESENTATIONCONTEXT_X, ++counter);
value = config.get_entry(buf);
Expand Down Expand Up @@ -189,9 +189,11 @@ OFCondition DcmAssociationConfigurationFile::parsePresentationContexts(
abstractSyntaxUID.erase(separator);

result = cfg.addPresentationContext(key, abstractSyntaxUID.c_str(), transferSyntaxKey.c_str(), scuMode);
if (result.bad()) return result;

} else found = OFFalse;
if (result.bad())
{
return result;
}
}
}
config.next_section(1);
}
Expand Down