oox/source/vml/vmlformatting.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6272747e0668e98c818c1830ae6d25186e6e649d
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Tue Nov 12 12:34:38 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sun Nov 24 16:40:18 2024 +0100

    cid#1607832 Overflowed constant
    
    Change-Id: Ie0d14ef985bebf4acdb08c460675ebba75f88a8d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177166
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins

diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx
index 3eefc8abd090..fa8dd5dc47f7 100644
--- a/oox/source/vml/vmlformatting.cxx
+++ b/oox/source/vml/vmlformatting.cxx
@@ -957,7 +957,7 @@ void ShadowModel::pushToPropMap(ShapePropertyMap& rPropMap, 
const GraphicHelper&
         ? nOffsetY < 0 ? table::ShadowLocation_TOP_LEFT : 
table::ShadowLocation_BOTTOM_LEFT
         : nOffsetY < 0 ? table::ShadowLocation_TOP_RIGHT : 
table::ShadowLocation_BOTTOM_RIGHT;
     // The width of the shadow is the average of the x and y values, see 
SwWW8ImplReader::MatchSdrItemsIntoFlySet().
-    aFormat.ShadowWidth = ((std::abs(nOffsetX) + std::abs(nOffsetY)) / 2);
+    aFormat.ShadowWidth = 
std::min<sal_Int32>(o3tl::saturating_add(std::abs(nOffsetX), 
std::abs(nOffsetY)) / 2, SHRT_MAX);
     rPropMap.setProperty(PROP_ShadowFormat, aFormat);
 }
 

Reply via email to