svtools/source/control/ctrlbox.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 2368f4de682edfff5092b5a4bf68d947706ef1e7
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Tue Jun 21 16:58:24 2022 +0200
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Jun 27 17:16:33 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>
    (cherry picked from commit ec03eef9b431048ea21a733c39c79b792b0f653c)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136393
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136451

diff --git a/svtools/source/control/ctrlbox.cxx 
b/svtools/source/control/ctrlbox.cxx
index 0b1c67e31980..393eea9e80fd 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 / 2; // see limitXCreatePixmap
-        gPreviewsPerDevice = nMaxDeviceHeight / gUserItemSz.Height();
+        assert(gUserItemSz.Height() != 0);
+        gPreviewsPerDevice = gUserItemSz.Height() == 0 ? 16 : nMaxDeviceHeight 
/ gUserItemSz.Height();
     }
 }
 

Reply via email to