svtools/source/control/ctrlbox.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
New commits: commit 72412c5773152a8023530b9807a42d7588f76f2b Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Tue Jun 21 16:58:24 2022 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Fri Jun 24 18:01:06 2022 +0200 svtools: avoid divide by zero in calcCustomItemSize See https://crashreport.libreoffice.org/stats/signature/%60anonymous%20namespace'::calcCustomItemSize Change-Id: I5f1b19b7679c73cf29952629469e5151395b2b12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136254 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index ecce7fa8af21..4ce41da23721 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -343,7 +343,8 @@ namespace gUserItemSz.setHeight(gUserItemSz.Height() / 10); size_t nMaxDeviceHeight = SAL_MAX_INT16 / 16; // see limitXCreatePixmap and be generous wrt up to x16 hidpi - gPreviewsPerDevice = nMaxDeviceHeight / gUserItemSz.Height(); + assert(gUserItemSz.Height() != 0); + gPreviewsPerDevice = gUserItemSz.Height() == 0 ? 16 : nMaxDeviceHeight / gUserItemSz.Height(); } }