diff OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp @ 4211:afad57ac30ef

enforcing parameter "enforceAligned" in PamReader
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 21 Sep 2020 18:10:31 +0200
parents 4d42408da117
children 0034f855c023
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp	Mon Sep 21 11:20:08 2020 +0200
+++ b/OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp	Mon Sep 21 18:10:31 2020 +0200
@@ -1257,7 +1257,9 @@
 
       case MimeType_Pam:
       {
-        PamReader reader;
+        // "true" means "enforce memory alignment": This is slower,
+        // but possibly avoids crash related to non-aligned memory access
+        PamReader reader(true);
         reader.ReadFromMemory(content);
         EmbedImage(reader);
         break;