Skip to content

Commit

Permalink
Merge pull request #116 from pps83/master-StreamVByte-padding
Browse files Browse the repository at this point in the history
Clear trailing bytes in StreamVByte to ensure bit-exact output
  • Loading branch information
lemire authored Jun 10, 2024
2 parents e9b452f + 006dc00 commit 5a45be3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions headers/streamvariablebyte.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ class StreamVByte : public IntegerCODEC {
count, std::numeric_limits<uint32_t>::max())),
0, 1);
nvalue = static_cast<size_t>(bytesWritten + 3) / 4;
for (size_t i = bytesWritten; i < nvalue * 4; ++i)
reinterpret_cast<uint8_t*>(out)[i] = 0;
}

const uint32_t *decodeArray(const uint32_t *in, const size_t /* count */,
Expand Down

0 comments on commit 5a45be3

Please sign in to comment.