aboutsummaryrefslogtreecommitdiff
path: root/nxcomp/src/EncodeBuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'nxcomp/src/EncodeBuffer.cpp')
-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_;