aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranz Zotter <fzotter@users.sourceforge.net>2006-08-14 20:58:37 +0000
committerFranz Zotter <fzotter@users.sourceforge.net>2006-08-14 20:58:37 +0000
commit2b886c9b5a2ef30cce29679dd8cbecdcdb17173b (patch)
tree43f2f8cd20cdb8e7ed2754c97c69de6a70ec446c
parent81eaaab1c44599515b2b2bf14b2384adbba1f273 (diff)
corrected bug in mtx_abs:
memory row*col was allocated, where row=atom_getint(argv[0]) and col=atom_getint(argv[1]), but argv elements were written to. i.e. lists larger than needed caused a crash. svn path=/trunk/externals/iem/iemmatrix/; revision=5598
-rw-r--r--src/mtx_abs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mtx_abs.c b/src/mtx_abs.c
index eae9f00..fb9e43f 100644
--- a/src/mtx_abs.c
+++ b/src/mtx_abs.c
@@ -19,10 +19,10 @@ static t_class *mtx_abs_class;
static void mtx_abs_matrix(t_mtx_binmtx *x, t_symbol *s, int argc, t_atom *argv)
{
- int row=atom_getfloat(argv++);
- int col=atom_getfloat(argv++);
+ int row=atom_getint(argv++);
+ int col=atom_getint(argv++);
t_atom *m;
- int n = argc-2;
+ int n = row*col;
if (argc<2){ post("mtx_abs: crippled matrix"); return; }
if ((col<1)||(row<1)) { post("mtx_abs: invalid dimensions"); return; }