From 739f74c54aaf109efbcd23d685ff84e7a31bc9bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Fri, 12 Oct 2001 07:52:13 +0000 Subject: [PATCH] fix out-of-bounds bug git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2864 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/math_fracbase.C | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mathed/math_fracbase.C b/src/mathed/math_fracbase.C index aa17ea7e82..0cb0086bb2 100644 --- a/src/mathed/math_fracbase.C +++ b/src/mathed/math_fracbase.C @@ -25,20 +25,22 @@ bool MathFracbaseInset::idxLeft(MathInset::idx_type &, bool MathFracbaseInset::idxUp(MathInset::idx_type & idx, - MathInset::pos_type &) const + MathInset::pos_type & pos) const { if (idx == 0) return false; idx = 0; + pos = std::min(pos, cell(idx).size()); return true; } bool MathFracbaseInset::idxDown(MathInset::idx_type & idx, - MathInset::pos_type &) const + MathInset::pos_type & pos) const { if (idx == 1) return false; idx = 1; + pos = std::min(pos, cell(idx).size()); return true; }