aboutsummaryrefslogtreecommitdiff
path: root/nxcomp/src
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2017-12-29 14:25:53 +0100
committerUlrich Sibiller <uli42@gmx.de>2017-12-29 14:26:14 +0100
commit367bec59524ffc3d005ae8908c5edf42e9b01ca7 (patch)
treed3bc2368895d03487b994fedff953ac457c4acc0 /nxcomp/src
parent6e98e35cf24016c9789be26d33d918f6e0e3c9a1 (diff)
downloadnx-libs-367bec59524ffc3d005ae8908c5edf42e9b01ca7.tar.gz
nx-libs-367bec59524ffc3d005ae8908c5edf42e9b01ca7.tar.bz2
nx-libs-367bec59524ffc3d005ae8908c5edf42e9b01ca7.zip
EncodeBuffer.cpp: add another VALGRIND guard
Fixes ArcticaProject/nx-libs#572
Diffstat (limited to 'nxcomp/src')
-rw-r--r--nxcomp/src/EncodeBuffer.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/nxcomp/src/EncodeBuffer.cpp b/nxcomp/src/EncodeBuffer.cpp
index 6e6a30e77..e6af38b71 100644
--- a/nxcomp/src/EncodeBuffer.cpp
+++ b/nxcomp/src/EncodeBuffer.cpp
@@ -108,7 +108,15 @@ void EncodeBuffer::fullReset()
size_ = initialSize_;
buffer_ = new unsigned char[size_ + ENCODE_BUFFER_PREFIX_SIZE +
- ENCODE_BUFFER_POSTFIX_SIZE] + ENCODE_BUFFER_PREFIX_SIZE;
+ ENCODE_BUFFER_POSTFIX_SIZE];
+
+ #ifdef VALGRIND
+
+ memset(buffer_, '\0', size_ + ENCODE_BUFFER_PREFIX_SIZE + ENCODE_BUFFER_POSTFIX_SIZE);
+
+ #endif
+
+ buffer_ += ENCODE_BUFFER_PREFIX_SIZE;
}
end_ = buffer_ + size_;