projects
/
pulseview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
479bcab
)
Padded data buffer so that reads do not overrun it.
author
Joel Holdsworth
<joel@airwebreathe.org.uk>
Mon, 1 Apr 2013 07:46:02 +0000
(08:46 +0100)
committer
Joel Holdsworth
<joel@airwebreathe.org.uk>
Mon, 8 Apr 2013 18:08:18 +0000
(19:08 +0100)
pv/data/snapshot.cpp
patch
|
blob
|
history
diff --git
a/pv/data/snapshot.cpp
b/pv/data/snapshot.cpp
index afd1e43e7c7b3169e792adb4336db4b171fcfd8c..8571dc6623be52b5b4918a2c00c79b52a1b74f6d 100644
(file)
--- a/
pv/data/snapshot.cpp
+++ b/
pv/data/snapshot.cpp
@@
-53,7
+53,8
@@
uint64_t Snapshot::get_sample_count() const
void Snapshot::append_data(void *data, uint64_t samples)
{
lock_guard<recursive_mutex> lock(_mutex);
- _data = realloc(_data, (_sample_count + samples) * _unit_size);
+ _data = realloc(_data, (_sample_count + samples) * _unit_size +
+ sizeof(uint64_t));
memcpy((uint8_t*)_data + _sample_count * _unit_size,
data, samples * _unit_size);
_sample_count += samples;