diff options
Diffstat (limited to 'xdelta3/xdelta3.c')
-rw-r--r-- | xdelta3/xdelta3.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/xdelta3/xdelta3.c b/xdelta3/xdelta3.c index 2264e8e..8dc43e0 100644 --- a/xdelta3/xdelta3.c +++ b/xdelta3/xdelta3.c | |||
@@ -3750,7 +3750,7 @@ xd3_source_match_setup (xd3_stream *stream, xoff_t srcpos) | |||
3750 | if (srcpos < stream->srcwin_cksum_pos && | 3750 | if (srcpos < stream->srcwin_cksum_pos && |
3751 | stream->srcwin_cksum_pos - srcpos > src->max_winsize) | 3751 | stream->srcwin_cksum_pos - srcpos > src->max_winsize) |
3752 | { | 3752 | { |
3753 | IF_DEBUG2(DP(RINT "[match_setup] rejected due to src->max_winsize " | 3753 | IF_DEBUG1(DP(RINT "[match_setup] rejected due to src->max_winsize " |
3754 | "distance eof=%"Q"u srcpos=%"Q"u max_winsz=%"Q"u\n", | 3754 | "distance eof=%"Q"u srcpos=%"Q"u max_winsz=%"Q"u\n", |
3755 | xd3_source_eof (src), | 3755 | xd3_source_eof (src), |
3756 | srcpos, src->max_winsize)); | 3756 | srcpos, src->max_winsize)); |
@@ -3866,6 +3866,7 @@ xd3_source_match_setup (xd3_stream *stream, xoff_t srcpos) | |||
3866 | 3866 | ||
3867 | bad: | 3867 | bad: |
3868 | stream->match_state = MATCH_SEARCHING; | 3868 | stream->match_state = MATCH_SEARCHING; |
3869 | stream->match_last_srcpos = srcpos; | ||
3869 | return 1; | 3870 | return 1; |
3870 | } | 3871 | } |
3871 | 3872 | ||
@@ -3956,16 +3957,18 @@ xd3_source_extend_match (xd3_stream *stream) | |||
3956 | { | 3957 | { |
3957 | if (ret == XD3_TOOFARBACK) | 3958 | if (ret == XD3_TOOFARBACK) |
3958 | { | 3959 | { |
3959 | IF_DEBUG1(DP(RINT "[maxback] frontier block %u TOOFARBACK block %u\n", | 3960 | IF_DEBUG1(DP(RINT "[maxback] %"Q"u TOOFARBACK: %u\n", |
3960 | stream->src->frontier_pos >> stream->src->shiftby, tryblk)); | 3961 | tryblk, stream->match_back)); |
3962 | |||
3961 | /* the starting position is too far back. */ | 3963 | /* the starting position is too far back. */ |
3962 | if (stream->match_back == 0) | 3964 | if (stream->match_back == 0) |
3963 | { | 3965 | { |
3964 | return 0; | 3966 | XD3_ASSERT(stream->match_fwd == 0); |
3967 | goto donefwd; | ||
3965 | } | 3968 | } |
3966 | 3969 | ||
3967 | /* search went too far back, continue forward. */ | 3970 | /* search went too far back, continue forward. */ |
3968 | break; | 3971 | goto doneback; |
3969 | } | 3972 | } |
3970 | 3973 | ||
3971 | /* could be a XD3_GETSRCBLK failure. */ | 3974 | /* could be a XD3_GETSRCBLK failure. */ |
@@ -4042,6 +4045,7 @@ xd3_source_extend_match (xd3_stream *stream) | |||
4042 | } | 4045 | } |
4043 | } | 4046 | } |
4044 | 4047 | ||
4048 | donefwd: | ||
4045 | stream->match_state = MATCH_SEARCHING; | 4049 | stream->match_state = MATCH_SEARCHING; |
4046 | 4050 | ||
4047 | /* If the match ends short of the last instruction end, we probably | 4051 | /* If the match ends short of the last instruction end, we probably |