diff options
author | josh.macdonald <jmacd@users.noreply.github.com> | 2007-09-13 09:59:55 +0000 |
---|---|---|
committer | josh.macdonald <jmacd@users.noreply.github.com> | 2007-09-13 09:59:55 +0000 |
commit | 94fc679c61ca73182ba9d473a36253364f8f1967 (patch) | |
tree | 50db96ee01d0a73bd2809bb2fcd0401955180850 /xdelta3/xdelta3-decode.h | |
parent | c453ed7952ef5ee3f7d799f8ed7ee113ee711e28 (diff) |
Fix secondary compression for recode. Now able to reproduce doytchin's
bug report by recoding an FGK as a DJW.
Diffstat (limited to 'xdelta3/xdelta3-decode.h')
-rw-r--r-- | xdelta3/xdelta3-decode.h | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/xdelta3/xdelta3-decode.h b/xdelta3/xdelta3-decode.h index fd41675..0368cdc 100644 --- a/xdelta3/xdelta3-decode.h +++ b/xdelta3/xdelta3-decode.h | |||
@@ -495,6 +495,27 @@ xd3_decode_finish_window (xd3_stream *stream) | |||
495 | } | 495 | } |
496 | 496 | ||
497 | static int | 497 | static int |
498 | xd3_decode_secondary_sections (xd3_stream *secondary_stream) | ||
499 | { | ||
500 | #if SECONDARY_ANY | ||
501 | int ret; | ||
502 | #define DECODE_SECONDARY_SECTION(UPPER,LOWER) \ | ||
503 | ((secondary_stream->dec_del_ind & VCD_ ## UPPER ## COMP) && \ | ||
504 | (ret = xd3_decode_secondary (secondary_stream, & secondary_stream-> LOWER ## _sect, \ | ||
505 | & xd3_sec_ ## LOWER (secondary_stream)))) | ||
506 | |||
507 | if (DECODE_SECONDARY_SECTION (DATA, data) || | ||
508 | DECODE_SECONDARY_SECTION (INST, inst) || | ||
509 | DECODE_SECONDARY_SECTION (ADDR, addr)) | ||
510 | { | ||
511 | return ret; | ||
512 | } | ||
513 | #undef DECODE_SECONDARY_SECTION | ||
514 | #endif | ||
515 | return 0; | ||
516 | } | ||
517 | |||
518 | static int | ||
498 | xd3_decode_sections (xd3_stream *stream) | 519 | xd3_decode_sections (xd3_stream *stream) |
499 | { | 520 | { |
500 | usize_t need, more, take; | 521 | usize_t need, more, take; |
@@ -557,19 +578,7 @@ xd3_decode_sections (xd3_stream *stream) | |||
557 | 578 | ||
558 | XD3_ASSERT (stream->dec_winbytes == need); | 579 | XD3_ASSERT (stream->dec_winbytes == need); |
559 | 580 | ||
560 | #if SECONDARY_ANY | 581 | if ((ret = xd3_decode_secondary_sections (stream))) { return ret; } |
561 | #define DECODE_SECONDARY_SECTION(UPPER,LOWER) \ | ||
562 | ((stream->dec_del_ind & VCD_ ## UPPER ## COMP) && \ | ||
563 | (ret = xd3_decode_secondary (stream, & stream-> LOWER ## _sect, \ | ||
564 | & xd3_sec_ ## LOWER (stream)))) | ||
565 | |||
566 | if (DECODE_SECONDARY_SECTION (DATA, data) || | ||
567 | DECODE_SECONDARY_SECTION (INST, inst) || | ||
568 | DECODE_SECONDARY_SECTION (ADDR, addr)) | ||
569 | { | ||
570 | return ret; | ||
571 | } | ||
572 | #endif | ||
573 | 582 | ||
574 | if (stream->flags & XD3_SKIP_EMIT) | 583 | if (stream->flags & XD3_SKIP_EMIT) |
575 | { | 584 | { |