changeset 6653:2640cf0fba20 machine-spirits

cont
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 20 Mar 2026 14:17:28 +0100
parents 786fa27700ca
children 68675600a967
files OrthancFramework/Sources/Images/PamReader.cpp
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/Images/PamReader.cpp	Fri Mar 20 14:13:01 2026 +0100
+++ b/OrthancFramework/Sources/Images/PamReader.cpp	Fri Mar 20 14:17:28 2026 +0100
@@ -200,7 +200,8 @@
     }
 
     uint64_t totalSize = pitch * height;
-    if (totalSize > MAX_PAM_IMAGE_BUFFER_SIZE)
+    if (totalSize > MAX_PAM_IMAGE_BUFFER_SIZE ||
+        static_cast<uint64_t>(static_cast<size_t>(totalSize)) != totalSize)
     {
       throw OrthancException(ErrorCode_BadFileFormat, "PAM image too large");
     }