13
0

Make sure that _get_vector writes a value to the output array even when veclen == 1. Fixes #3461.

git-svn-id: svn://localhost/ardour2/branches/3.0@7808 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2010-09-20 00:57:44 +00:00
parent e47d463309
commit a212e7eec9

View File

@ -264,7 +264,7 @@ Curve::_get_vector (double x0, double x1, float *vec, int32_t veclen)
return;
}
if (npoints == 1 ) {
if (npoints == 1) {
for (i = 0; i < veclen; ++i) {
vec[i] = _list.events().front()->value;
@ -308,12 +308,13 @@ Curve::_get_vector (double x0, double x1, float *vec, int32_t veclen)
rx = lx;
if (veclen > 1) {
dx = (hx - lx) / (veclen - 1);
} else {
dx = 0;
}
dx = (hx - lx) / (veclen-1);
for (i = 0; i < veclen; ++i, rx += dx) {
vec[i] = multipoint_eval (rx);
}
for (i = 0; i < veclen; ++i, rx += dx) {
vec[i] = multipoint_eval (rx);
}
}