Improper use of memset() in constructor
Opened this issue · 0 comments
edgar-bonet commented
The MedianFilter
constructor contains the statement
memset(_buffer, _medianSize, preFill);
This is incorrect for two reasons:
- The last two arguments are in the wrong order.
memset()
fills all the bytes of the designated memory area with the same value, whereas anint
is at least two bytes.
It would be more appropriate to fill the buffer with a loop.