# HG changeset patch # User Sebastien Jodogne # Date 1774012648 -3600 # Node ID 2640cf0fba208ded6e9da989ae887181daac7f0f # Parent 786fa27700ca4584fd6886c8396ad40301d8e39c cont diff -r 786fa27700ca -r 2640cf0fba20 OrthancFramework/Sources/Images/PamReader.cpp --- 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(static_cast(totalSize)) != totalSize) { throw OrthancException(ErrorCode_BadFileFormat, "PAM image too large"); }