From dc7cc3b67f2342d642abfd79b9d19ca3b897a895 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Mon, 29 Jun 2020 02:42:14 +1000 Subject: [PATCH] Common/ByteStream: Fix buffer corruption in MemoryByteStream --- src/common/byte_stream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/byte_stream.cpp b/src/common/byte_stream.cpp index df1f01401..f380c2a4b 100644 --- a/src/common/byte_stream.cpp +++ b/src/common/byte_stream.cpp @@ -479,7 +479,7 @@ bool MemoryByteStream::WriteByte(u8 SourceByte) { if (m_iPosition < m_iSize) { - m_pMemory[m_iSize++] = SourceByte; + m_pMemory[m_iPosition++] = SourceByte; return true; }