Tier0: fix bug in CIOStream::Pad()

We must always use the remainder when writing out padding. The bug was that it would still do the full count or PAD_BUF_SIZE at all times even though the remainder is 20 for example. This fixes the last few rare alignment problems.
This commit is contained in:
Kawe Mazidjatari 2025-02-02 14:51:29 +01:00
parent c8ee0d4333
commit e63660b549

View File

@ -293,7 +293,7 @@ void CIOStream::Pad(const size_t count)
while (remainder)
{
const size_t writeCount = (std::min)(count, PAD_BUF_SIZE);
const size_t writeCount = (std::min)(remainder, PAD_BUF_SIZE);
Write(s_padBuf, writeCount);
remainder -= writeCount;