Page 1 of 1

Out of memory in MakeDocumentFromStream

Posted: Wed Jan 22, 2025 6:33 pm
by a.mancini
Hello,

I would like to report an issue with the MakeDocumentFromStream function.

Steps to Reproduce:
1. Set the linewidth property to 0 (no automatic carriage return).
2. Write a single line with 2548 characters.

Observed Issue:
When reading the stream in MakeDocumentFromStream, the value of the Chunk variable during the second read is identical to the Buffer variable. As a result, the Buffer loses the first 1024 characters that were initially read.

Proposed Fix:
I resolved the issue (at least in my case) by replacing the following line:

Stream.ReadBuffer(PRVAnsiChar(Chunk)^, ChunkSize);

with:
Stream.ReadBuffer(Chunk[1], ChunkSize);

This seems to fix the iusse.

Best regards,
Alessandro Mancini