Commit 873d05d
committed
Refactor LZMA decompression API and integrate into ProcessImage
- Rename `ProcessCompressedData` to `static void *DecompressLzmaData(const void *data, size_t data_size, size_t *decompressed_size)`
- Change all failure paths in `DecompressLzmaData` (header truncation, size limits, allocation failure, decompression failure, unsupported) to `return NULL` instead of `false`
- Remove initial DEBUG of compressed data segment size; add `DEBUG("LZMA decompressed %zu bytes", data_size)` after successful decompression
- Update `ProcessImage` to:
- Log raw segment size via `DEBUG("Data segment size: %zu bytes", context->data_size)`
- Use `IsDataCompressed` flag to choose between direct use of `context->data` and calling `DecompressLzmaData`
- Store returned buffer and size in local `data`/`data_size`, call `process_opcodes`, free the buffer only if decompressed, and return the bool result1 parent 5413c27 commit 873d05d
1 file changed
+39
-35
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | 208 | | |
215 | 209 | | |
216 | 210 | | |
| |||
225 | 219 | | |
226 | 220 | | |
227 | 221 | | |
228 | | - | |
| 222 | + | |
| 223 | + | |
229 | 224 | | |
230 | 225 | | |
231 | | - | |
232 | | - | |
233 | | - | |
| 226 | + | |
234 | 227 | | |
235 | | - | |
| 228 | + | |
236 | 229 | | |
237 | 230 | | |
238 | 231 | | |
239 | 232 | | |
240 | | - | |
| 233 | + | |
241 | 234 | | |
242 | 235 | | |
243 | 236 | | |
244 | | - | |
| 237 | + | |
245 | 238 | | |
246 | 239 | | |
247 | 240 | | |
248 | 241 | | |
249 | | - | |
| 242 | + | |
250 | 243 | | |
251 | 244 | | |
252 | 245 | | |
253 | 246 | | |
254 | 247 | | |
255 | | - | |
| 248 | + | |
256 | 249 | | |
257 | 250 | | |
258 | | - | |
| 251 | + | |
259 | 252 | | |
260 | 253 | | |
261 | | - | |
| 254 | + | |
262 | 255 | | |
263 | 256 | | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
| 257 | + | |
| 258 | + | |
268 | 259 | | |
269 | 260 | | |
270 | | - | |
| 261 | + | |
271 | 262 | | |
272 | 263 | | |
273 | 264 | | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | 265 | | |
284 | 266 | | |
285 | 267 | | |
| |||
444 | 426 | | |
445 | 427 | | |
446 | 428 | | |
447 | | - | |
448 | 429 | | |
449 | 430 | | |
450 | 431 | | |
451 | | - | |
452 | | - | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
453 | 449 | | |
454 | | - | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
455 | 458 | | |
| 459 | + | |
456 | 460 | | |
0 commit comments