Commit 9b981acc authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

fix more invalid reads

parent 2316e4cb
......@@ -177,15 +177,17 @@ void hlshelf_float(t_hlshelf *x,t_floatarg f)
static void *hlshelf_new(t_symbol* s,t_int argc, t_atom* at)
{
t_hlshelf *x = (t_hlshelf *)pd_new(hlshelf_class);
t_float k0 = atom_getfloat(at);
t_float k1 = atom_getfloat(at+1);
t_float k2 = atom_getfloat(at+2);
t_float f1 = atom_getfloat(at+3);
t_float f2 = atom_getfloat(at+4);
f1 = atom_getfloat(at);
f2 = atom_getfloat(at);
t_float k0 = argc ? atom_getfloatarg(0, argc--, at++) : 0;
t_float k1 = argc ? atom_getfloatarg(0, argc--, at++) : 0;
t_float k2 = argc ? atom_getfloatarg(0, argc--, at++) : 0;
t_float f1 = argc ? atom_getfloatarg(0, argc--, at++) : 0;
t_float f2 = argc ? atom_getfloatarg(0, argc--, at++) : 0;
/* For some reason f1 and f2 got set to the original value
of at[0] below. Not sure why. Anyway, I just set them to
k0 which should be functionally equivalent. */
f1 = k0;
f2 = k0;
if ((f1 == 0.0f && f2 == 0.0f) || f1 > f2){ /* all gains = 0db */
f1 = 150.0f;
......
......@@ -35,7 +35,7 @@ static void *str_new(t_symbol *s, int argc, t_atom *argv)
void str_setup(void)
{
str_class = class_new(gensym("str"), (t_newmethod)str_new, 0, sizeof(t_str), 0, 0);
str_class = class_new(gensym("str"), (t_newmethod)str_new, 0, sizeof(t_str), 0, A_GIMME, 0);
}
#else //ifndef PD_BLOBS
/* Make a _real_ str object: */
......@@ -687,7 +687,7 @@ static void *str_new(t_symbol *s, int argc, t_atom *argv)
x->x_function = 0; /* default = string */
x->x_nsplit = 0L;
next = 0; /* index of next argument */
if (argv[0].a_type == A_SYMBOL)
if (argc && argv[0].a_type == A_SYMBOL)
{ /* the first argument may be a selector */
atom_string(&argv[0], (char *)x->x_buf.s_data, MAXPDSTRING);
for (i = 0; i < n_functions; ++i)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment