Commit a49e1165 authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼

average: fixes out-of-bound access in average hook (closes #249)

parent 713e875f
......@@ -39,7 +39,7 @@ namespace node {
class AverageHook : public Hook {
protected:
int offset;
unsigned offset;
std::bitset<MAX_SAMPLE_LENGTH> mask;
vlist signal_names;
......@@ -164,6 +164,10 @@ public:
}
avg = sum / n;
if (offset >= smp->length)
return Reason::ERROR;
sample_data_insert(smp, (union signal_data *) &avg, offset, 1);
smp->signals = &signals;
......
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