Commit 2e951bd
Qian Gong
Fix floating-point exception in Zstd::Decompress
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.1 parent e420727 commit 2e951bd
1 file changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
115 | 127 | | |
116 | 128 | | |
117 | 129 | | |
| |||
137 | 149 | | |
138 | 150 | | |
139 | 151 | | |
140 | | - | |
| 152 | + | |
0 commit comments