From: André Pönitz Date: Fri, 12 Oct 2001 07:52:13 +0000 (+0000) Subject: fix out-of-bounds bug X-Git-Tag: 1.6.10~20496 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=739f74c54aaf109efbcd23d685ff84e7a31bc9bf;p=features.git fix out-of-bounds bug git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2864 a592a061-630c-0410-9148-cb99ea01b6c8 --- 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; }