vcl/source/gdi/TypeSerializer.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 788ef4f347d8a3c87d45d38ce6bf13cdd3dd76a2
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Mon Sep 25 10:40:50 2023 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Mon Sep 25 14:17:17 2023 +0200

    ofz#62439 Integer-overflow on scale using SAL_MIN_INT32
    
    Change-Id: Ib26feee174caab9f515cd88cc3cb4a83debb0d99
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157242
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/vcl/source/gdi/TypeSerializer.cxx 
b/vcl/source/gdi/TypeSerializer.cxx
index 9144650154af..49890fc38ea0 100644
--- a/vcl/source/gdi/TypeSerializer.cxx
+++ b/vcl/source/gdi/TypeSerializer.cxx
@@ -435,6 +435,10 @@ static bool UselessScaleForMapMode(const Fraction& rScale)
 {
     if (!rScale.IsValid())
         return true;
+    // ofz#62439 negative numbers are multiplied by -1, MIN_INT32 * -1
+    // cannot be expressed as an int
+    if (rScale.GetNumerator() == std::numeric_limits<sal_Int32>::min())
+        return true;
     if (static_cast<double>(rScale) < 0.0)
         return true;
     return false;

Reply via email to