Skip to content

Fix save-stream buffer sizes - #104

Open
mischa85 wants to merge 5 commits into
OpenTS-Developers:mainfrom
mischa85:save-stream-buffer-sizes
Open

Fix save-stream buffer sizes#104
mischa85 wants to merge 5 commits into
OpenTS-Developers:mainfrom
mischa85:save-stream-buffer-sizes

Conversation

@mischa85

@mischa85 mischa85 commented Sep 1, 2026

Copy link
Copy Markdown

Four small fixes in the save stream (CStreamClass, LZOPipe/LZOStraw):

  • The compressed-output buffer is 64 KB, but LZO output can grow to ~68.7 KB
    on incompressible input. That's a heap overrun that has been in the game since
    1999, masked only because game state compresses well.
  • The final block's header claims 64 KB uncompressed even when partial, masked by the reader stopping at the content length.
  • Both LZO dictionaries are allocated as 64*1024 instead of
    LZO1X_MEM_COMPRESS (16384 * sizeof(lzo_byte *)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant