Skip to content

Commit

Permalink
Handle another invalid case
Browse files Browse the repository at this point in the history
  • Loading branch information
malaterre committed Sep 13, 2022
1 parent 48d3441 commit ad781fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Source/MediaStorageAndFileFormat/gdcmCleaner.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -761,11 +761,18 @@ static bool CleanCSA(DataSet &ds, const DataElement &de) {
if (bv->GetLength() >= 10 && memcmp(bv->GetPointer(), psd_ocm, 10) == 0) {
return true;
}
// ANGIOHEAD case. This is a DICOM Explicit with a odd ending:
static const char end[] = "END! ";
if (bv->GetLength() >= 10 &&
memcmp(bv->GetPointer() + bv->GetLength() - 10, end, 10) == 0) {
return true;
}
// byte-swapped ANGIOHEAD
static const char ned[] = "NE!D ";
if (bv->GetLength() >= 10 &&
memcmp(bv->GetPointer() + bv->GetLength() - 10, ned, 10) == 0) {
return true;
}
const bool zero = isAllZero(bv->GetPointer(), bv->GetLength());
if (zero) return true;

Expand Down
2 changes: 1 addition & 1 deletion Utilities/gdcmext/csa.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static bool read_magic(struct app *self) {
magic = NOMAGIC;
} else if (n == 0x7364703c && unused == 0x6f633c3e) // aka '<pds><co'
{
// 'PET_REPLAY_PARAM'
// 'PET_REPLAY_PARAM'
return false;
} else if (n == 0x31305356 && unused == 0x2010403) { // aka 'VS01' ...
// technically could be reserved; should not happen in the wild
Expand Down

0 comments on commit ad781fd

Please sign in to comment.