Mercurial > hg > octave-nkf
changeset 9239:f29db0a0aa85
fix another indexing bug in liboctinterp
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 22 May 2009 10:46:13 +0200 |
parents | 0ae2b6617005 |
children | f27a8c07f0b2 |
files | src/ChangeLog src/ov-base-mat.cc |
diffstat | 2 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2009-05-22 Jaroslav Hajek <highegg@gmail.com> + + * src/ov-base-mat.cc (octave_base_matrix<MT>::assign (const + octave_value_list, typename MT::element_type)): Avoid out of bounds + assignments. + 2009-05-21 Michael Goffioul <michael.goffioul@gmail.com> * graphics.cc (figure::properties::get_boundingbox,
--- a/src/ov-base-mat.cc +++ b/src/ov-base-mat.cc @@ -334,7 +334,7 @@ { Array<idx_vector> idx_vec (n_idx); bool scalar_opt = n_idx == nd; - const dim_vector dv = matrix.dims (); + const dim_vector dv = matrix.dims ().redim (n_idx); for (octave_idx_type i = 0; i < n_idx; i++) { @@ -344,7 +344,7 @@ break; scalar_opt = (scalar_opt && idx_vec(i).is_scalar () - && idx_vec(i)(0) < dv(0)); + && idx_vec(i)(0) < dv(i)); } if (! error_state)