Skip to content

Fix save-stream buffer sizes - #101

Closed
mischa85 wants to merge 5 commits into
OpenTS-Developers:mainfrom
mischa85:main
Closed

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

Conversation

@mischa85

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 *)).

@mischa85

mischa85 commented Sep 1, 2026

Copy link
Copy Markdown
Author

Superseded by #104. Same five commits, moved off my fork's main onto a topic branch.

@mischa85 mischa85 closed this Sep 1, 2026
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