diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index ce0f18c004..c0c9e9345f 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -10422,7 +10422,7 @@ bool wxRichTextImageBlock::WriteHex(wxOutputStream& stream) int bufSize = 100000; if (int(m_dataSize+1) < bufSize) - bufSize = m_dataSize+1; + bufSize = m_dataSize; char* buf = new char[bufSize+1]; int left = m_dataSize;