dae6fd9747
[ Upstream commit 2d3dff577dd0ea8fe9637a13822f7603c4a881c8 ]
The iio_generic_buffer can return garbage values when the total size of
scan data is not a multiple of the largest element in the scan. This can be
demonstrated by reading a scan, consisting, for example of one 4-byte and
one 2-byte element, where the 4-byte element is first in the buffer.
The IIO generic buffer code does not take into account the last two
padding bytes that are needed to ensure that the 4-byte data for next
scan is correctly aligned.
Add the padding bytes required to align the next sample with the scan size.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Fixes:
|
||
---|---|---|
.. | ||
.gitignore | ||
Build | ||
Makefile | ||
iio_event_monitor.c | ||
iio_generic_buffer.c | ||
iio_utils.c | ||
iio_utils.h | ||
lsiio.c |