Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
nerrons
purr-data
Commits
d6cfcc7b
Commit
d6cfcc7b
authored
Aug 11, 2017
by
Jonathan Wilkes
Browse files
fix invalid reads in iemmatrix
parent
9b981acc
Changes
5
Hide whitespace changes
Inline
Side-by-side
externals/iem/iemmatrix/src/mtx_bessel.c
View file @
d6cfcc7b
...
...
@@ -83,7 +83,7 @@ static void *newMTXBessel (t_symbol *s, int argc, t_atom *argv)
x
->
h_re
=
0
;
x
->
h_im
=
0
;
x
->
l
=
0
;
fsym
=
atom_getsymbol
(
argv
);
fsym
=
argc
?
atom_getsymbol
(
argv
)
:
&
s_
;
if
(
fsym
->
s_name
!=
0
)
whichfunction
=
fsym
->
s_name
[
0
];
switch
(
whichfunction
)
{
...
...
@@ -96,7 +96,7 @@ static void *newMTXBessel (t_symbol *s, int argc, t_atom *argv)
case
'Y'
:
x
->
list_h_im_out
=
outlet_new
(
&
x
->
x_obj
,
gensym
(
"matrix"
));
}
nmax
=
(
int
)
atom_getfloat
(
argv
+
1
);
nmax
=
argc
>
1
?
(
int
)
atom_getfloat
(
argv
+
1
)
:
0
;
if
(
nmax
<
0
)
nmax
=
0
;
x
->
nmax
=
nmax
;
...
...
externals/iem/iemmatrix/src/mtx_eig.c
View file @
d6cfcc7b
...
...
@@ -114,7 +114,7 @@ static void *newMTXEig (t_symbol *s, int argc, t_atom *argv)
x
->
list_l_out_re
=
outlet_new
(
&
x
->
x_obj
,
gensym
(
"list"
));
x
->
list_l_out_im
=
outlet_new
(
&
x
->
x_obj
,
gensym
(
"list"
));
if
(
atom_getsymbol
(
argv
)
==
gensym
(
"v"
))
{
if
(
argc
&&
atom_getsymbol
(
argv
)
==
gensym
(
"v"
))
{
x
->
withevs
=
1
;
x
->
list_q_out_re
=
outlet_new
(
&
x
->
x_obj
,
gensym
(
"matrix"
));
x
->
list_q_out_im
=
outlet_new
(
&
x
->
x_obj
,
gensym
(
"matrix"
));
...
...
externals/iem/iemmatrix/src/mtx_ei~.c
View file @
d6cfcc7b
...
...
@@ -22,6 +22,7 @@ void *newMtxEITilde(t_symbol *s, int argc, t_atom *argv)
{
int
sd
=
1
;
int
sg
=
1
;
t_atom
sane_defaults
[
1
];
mtx_ei_tilde
*
x
=
(
mtx_ei_tilde
*
)
pd_new
(
mtx_ei_tilde_class
);
x
->
sig_in_left
=
0
;
x
->
sig_in_right
=
0
;
...
...
@@ -32,6 +33,12 @@ void *newMtxEITilde(t_symbol *s, int argc, t_atom *argv)
inlet_new
(
&
x
->
x_obj
,
&
x
->
x_obj
.
ob_pd
,
&
s_signal
,
&
s_signal
);
x
->
message_outlet
=
(
t_outlet
*
)
outlet_new
(
&
x
->
x_obj
,
&
s_list
);
/* Prevent an invalid read */
if
(
!
argc
)
{
SETFLOAT
(
sane_defaults
,
0
.);
argv
=
sane_defaults
;
argc
=
1
;
}
if
(
argc
>
2
)
{
sd
=
atom_getint
(
argv
++
);
sg
=
argc
-
1
;
...
...
externals/iem/iemmatrix/src/mtx_spherical_harmonics.c
View file @
d6cfcc7b
...
...
@@ -83,7 +83,7 @@ static void *newMTXSh (t_symbol *s, int argc, t_atom *argv)
x
->
theta
=
0
;
x
->
ws
=
0
;
x
->
l
=
0
;
nmax
=
(
int
)
atom_getfloat
(
argv
);
nmax
=
argc
?
(
int
)
atom_getfloat
(
argv
)
:
0
;
if
(
nmax
<
0
)
nmax
=
0
;
x
->
nmax
=
nmax
;
...
...
externals/iem/iemmatrix/src/mtx_spherical_radial.c
View file @
d6cfcc7b
...
...
@@ -80,7 +80,7 @@ static void *newMTXSph (t_symbol *s, int argc, t_atom *argv)
x
->
h_re
=
0
;
x
->
h_im
=
0
;
x
->
l
=
0
;
fsym
=
atom_getsymbol
(
argv
);
fsym
=
argc
?
atom_getsymbol
(
argv
)
:
&
s_
;
if
(
fsym
->
s_name
!=
0
)
whichfunction
=
fsym
->
s_name
[
0
];
switch
(
whichfunction
)
{
...
...
@@ -93,7 +93,7 @@ static void *newMTXSph (t_symbol *s, int argc, t_atom *argv)
case
'y'
:
x
->
list_h_im_out
=
outlet_new
(
&
x
->
x_obj
,
gensym
(
"matrix"
));
}
nmax
=
(
int
)
atom_getfloat
(
argv
+
1
);
nmax
=
argc
>
1
?
(
int
)
atom_getfloat
(
argv
+
1
)
:
0
;
if
(
nmax
<
0
)
nmax
=
0
;
x
->
nmax
=
nmax
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment