Skip to content

Fix floating-point exception in Zstd::Decompress#254

Merged
JieyangChen7 merged 1 commit intoCODARcode:masterfrom
gqian-coder:master
Feb 5, 2026
Merged

Fix floating-point exception in Zstd::Decompress#254
JieyangChen7 merged 1 commit intoCODARcode:masterfrom
gqian-coder:master

Conversation

@gqian-coder
Copy link
Contributor

Bug: When decompressing multiple variables sequentially, if the decompressed size (actual_out_count) was larger than the current buffer_size, the Resize() function would free and reallocate BOTH in_data AND out_data. This destroyed the compressed data that was just copied to in_data, causing ZSTD_decompress to read garbage/zeros and produce invalid output.

Fix: Only reallocate out_data when needed for larger output, leaving in_data (which contains the compressed data) untouched.

Bug: When decompressing multiple variables sequentially, if the decompressed
size (actual_out_count) was larger than the current buffer_size, the Resize()
function would free and reallocate BOTH in_data AND out_data. This destroyed
the compressed data that was just copied to in_data, causing ZSTD_decompress
to read garbage/zeros and produce invalid output.

Fix: Only reallocate out_data when needed for larger output, leaving in_data
(which contains the compressed data) untouched.
@JieyangChen7 JieyangChen7 merged commit b40d1a7 into CODARcode:master Feb 5, 2026
6 checks passed
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.

2 participants