aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniil Cherednik <dan.cherednik@gmail.com>2016-04-22 02:29:54 +0300
committerDaniil Cherednik <dan.cherednik@gmail.com>2016-04-22 02:49:07 +0300
commitd31ca6265e9c19b0f5dfd39a89b20e4ffb201234 (patch)
tree410d6d872853951c7c193d7a7388e4aacaa8d443
parent1c81b6e3d2b26c5e857fdce3131ed18ba6cf6ac5 (diff)
downloadatracdenc-d31ca6265e9c19b0f5dfd39a89b20e4ffb201234.tar.gz
fix memory corruption
-rw-r--r--src/bitstream/bitstream.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bitstream/bitstream.cpp b/src/bitstream/bitstream.cpp
index f05b32c..d916f52 100644
--- a/src/bitstream/bitstream.cpp
+++ b/src/bitstream/bitstream.cpp
@@ -20,7 +20,7 @@ void TBitStream::Write(unsigned long long val, int n) {
const int bytesPos = BitsUsed / 8;
const int overlap = BitsUsed % 8;
- if (overlap || bitsReq > 0) {
+ if (overlap || bitsReq >= 0) {
Buf.resize(Buf.size() + (bitsReq / 8 + (overlap ? 2 : 1 )), 0);
}
TMix t;