Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Wynn
purr-data
Commits
23c9d32d
Commit
23c9d32d
authored
Oct 23, 2016
by
Jonathan Wilkes
Browse files
fix crasher with scalar dialog handling of vector data
parent
5cb2f8b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
pd/nw/dialog_data.html
View file @
23c9d32d
...
@@ -62,7 +62,7 @@ function apply() {
...
@@ -62,7 +62,7 @@ function apply() {
data_string
+=
"
;
\n
"
;
data_string
+=
"
;
\n
"
;
// now tack on any vector data we may have
// now tack on any vector data we may have
if
(
vector_textarea
)
{
if
(
vector_textarea
)
{
data_string
+=
vector_textarea
.
textContent
;
data_string
+=
vector_textarea
.
value
;
// strip off the trailing semicolon. Otherwise Pd will crash...
// strip off the trailing semicolon. Otherwise Pd will crash...
data_string
=
data_string
.
slice
(
0
,
-
1
);
data_string
=
data_string
.
slice
(
0
,
-
1
);
}
}
...
...
pd/src/g_readwrite.c
View file @
23c9d32d
...
@@ -341,8 +341,17 @@ void canvas_dataproperties(t_canvas *x, t_scalar *sc, t_binbuf *b)
...
@@ -341,8 +341,17 @@ void canvas_dataproperties(t_canvas *x, t_scalar *sc, t_binbuf *b)
&&
(
template
=
template_findbyname
(((
t_scalar
*
)
newone
)
->
sc_template
)))
&&
(
template
=
template_findbyname
(((
t_scalar
*
)
newone
)
->
sc_template
)))
{
{
/* copy new one to old one and delete new one */
/* copy new one to old one and delete new one */
memcpy
(
&
((
t_scalar
*
)
oldone
)
->
sc_vec
,
&
((
t_scalar
*
)
newone
)
->
sc_vec
,
int
i
;
template
->
t_n
*
sizeof
(
t_word
));
/* swap out the sc_vec field. That way we'll keep the one from
the new scalar, and the old one will get freed by word_free (which
gets called from pd_free below)
*/
for
(
i
=
0
;
i
<
template
->
t_n
;
i
++
)
{
t_word
w
=
((
t_scalar
*
)
newone
)
->
sc_vec
[
i
];
((
t_scalar
*
)
newone
)
->
sc_vec
[
i
]
=
((
t_scalar
*
)
oldone
)
->
sc_vec
[
i
];
((
t_scalar
*
)
oldone
)
->
sc_vec
[
i
]
=
w
;
}
pd_free
(
&
newone
->
g_pd
);
pd_free
(
&
newone
->
g_pd
);
if
(
glist_isvisible
(
x
))
if
(
glist_isvisible
(
x
))
{
{
...
...
Write
Preview
Supports
Markdown
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