From 6b3782e07b445585a5ed2efbc0589aa638178134 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sat, 15 Jun 2024 14:48:37 +0200 Subject: [PATCH] Prevent division by zero Fixes crash reported at https://marc.info/?l=lyx-users&m=171842978728676 (cherry picked from commit 0fc8ee5ace22c11175cb93f5b6f7310cc4d646c1) --- src/insets/InsetTabular.cpp | 2 +- status.24x | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 31aac87dc9..5a67154ee0 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -1330,7 +1330,7 @@ bool Tabular::updateColumnWidths(MetricsInfo & mi) changed = true; } } - if (changed && restwidth > 0) + if (changed && restwidth > 0 && restcols != 0) vcolwidth = restwidth / restcols; } diff --git a/status.24x b/status.24x index 54dd480d50..54619fe8ff 100644 --- a/status.24x +++ b/status.24x @@ -41,6 +41,8 @@ What's new - The performance of LyX with large insets on slower computers has been improved a lot (bug 12297). +- Fix crash with multirow tables. + * DOCUMENTATION AND LOCALIZATION -- 2.39.5