vcl/source/bitmap/bitmap.cxx | 4 ++++ 1 file changed, 4 insertions(+) New commits: commit f27daa7b3997733cb6a25fee145b093be1cef91a Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sun Sep 21 10:40:14 2025 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sun Sep 21 15:51:04 2025 +0200
cid#1666319 Division or modulo by float zero Change-Id: I3babfb373fe6c3b5b3738c9d70368b236efd4d20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191285 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/vcl/source/bitmap/bitmap.cxx b/vcl/source/bitmap/bitmap.cxx index 069c9b4b56d3..f0404fa80a18 100644 --- a/vcl/source/bitmap/bitmap.cxx +++ b/vcl/source/bitmap/bitmap.cxx @@ -2169,6 +2169,10 @@ Color Bitmap::GetAverageColor() const nCnt++; } } + + if(!nCnt) + return Color(); + return Color(ColorAlpha, static_cast<sal_uInt8>(fAlpha / nCnt), static_cast<sal_uInt8>(fRed / nCnt), static_cast<sal_uInt8>(fGreen / nCnt),