diff options
author | Daniil Cherednik <dan.cherednik@gmail.com> | 2016-04-22 01:35:31 +0300 |
---|---|---|
committer | Daniil Cherednik <dan.cherednik@gmail.com> | 2016-04-22 02:49:07 +0300 |
commit | 1c81b6e3d2b26c5e857fdce3131ed18ba6cf6ac5 (patch) | |
tree | 817ed5f83831b0962af07ad042598d0938fa86f2 | |
parent | eb5f6b9b5507607635726f85ef7e1842a7eaaf7e (diff) | |
download | atracdenc-1c81b6e3d2b26c5e857fdce3131ed18ba6cf6ac5.tar.gz |
fix memory corruption
-rw-r--r-- | src/bitstream/bitstream.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bitstream/bitstream.cpp b/src/bitstream/bitstream.cpp index 7de4873..f05b32c 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 (bitsReq > 0) { + if (overlap || bitsReq > 0) { Buf.resize(Buf.size() + (bitsReq / 8 + (overlap ? 2 : 1 )), 0); } TMix t; |