[LyX/2.4.x] Prevent division by zero

Richard Kimberly Heck rikiheck at lyx.org
Sat Jun 15 16:05:53 UTC 2024


commit 6b3782e07b445585a5ed2efbc0589aa638178134
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Jun 15 14:48:37 2024 +0200

    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
 


More information about the lyx-cvs mailing list