diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-06-21 16:58:24 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-06-27 17:16:33 +0200 |
commit | 2368f4de682edfff5092b5a4bf68d947706ef1e7 (patch) | |
tree | 48a15942b7e5273a95ba64ec81db787e69b2c8f1 | |
parent | tdf#148522 svx: fix undo of cell border changes text alignment in other cells (diff) | |
download | core-2368f4de682edfff5092b5a4bf68d947706ef1e7.tar.gz core-2368f4de682edfff5092b5a4bf68d947706ef1e7.zip |
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 <caolanm@redhat.com>
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
(cherry picked from commit ec03eef9b431048ea21a733c39c79b792b0f653c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136393
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136451
-rw-r--r-- | svtools/source/control/ctrlbox.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
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(); } } |