From 48d344155507924861dfd09ace35145c9539e475 Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Tue, 13 Sep 2022 08:34:01 +0200 Subject: [PATCH] Handle invalid case --- Source/MediaStorageAndFileFormat/gdcmCleaner.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/MediaStorageAndFileFormat/gdcmCleaner.cxx b/Source/MediaStorageAndFileFormat/gdcmCleaner.cxx index 0a79346c8..f58691cdc 100644 --- a/Source/MediaStorageAndFileFormat/gdcmCleaner.cxx +++ b/Source/MediaStorageAndFileFormat/gdcmCleaner.cxx @@ -756,6 +756,11 @@ static bool CleanCSA(DataSet &ds, const DataElement &de) { if (bv->GetLength() >= 10 && memcmp(bv->GetPointer(), pds_com, 10) == 0) { return true; } + static const char psd_ocm[] = "poc>m"; + // byte-swap PET_REPLAY_PARAM case: + if (bv->GetLength() >= 10 && memcmp(bv->GetPointer(), psd_ocm, 10) == 0) { + return true; + } static const char end[] = "END! "; if (bv->GetLength() >= 10 && memcmp(bv->GetPointer() + bv->GetLength() - 10, end, 10) == 0) {