diff options
author | josh.macdonald <jmacd@users.noreply.github.com> | 2010-02-11 11:34:19 +0000 |
---|---|---|
committer | josh.macdonald <jmacd@users.noreply.github.com> | 2010-02-11 11:34:19 +0000 |
commit | f241a281e80aaf1aa90fe1a0d9db206396cd6a79 (patch) | |
tree | 7531181e6cb7cca542aff2843be7eea863795535 /xdelta3/xdelta3.c | |
parent | 3dbebbe46096e17c0298f1cbe315d10b35b4f9ee (diff) |
Running xdelta3-regtest.py. Observed a bug in recently-added
match-setup code, using source_eof instead of frontier position.
Diffstat (limited to 'xdelta3/xdelta3.c')
-rw-r--r-- | xdelta3/xdelta3.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/xdelta3/xdelta3.c b/xdelta3/xdelta3.c index 98c0e57..6d014aa 100644 --- a/xdelta3/xdelta3.c +++ b/xdelta3/xdelta3.c | |||
@@ -4342,6 +4342,7 @@ xd3_source_match_setup (xd3_stream *stream, xoff_t srcpos) | |||
4342 | { | 4342 | { |
4343 | xd3_source *src = stream->src; | 4343 | xd3_source *src = stream->src; |
4344 | usize_t greedy_or_not; | 4344 | usize_t greedy_or_not; |
4345 | xoff_t frontier_pos; | ||
4345 | 4346 | ||
4346 | stream->match_maxback = 0; | 4347 | stream->match_maxback = 0; |
4347 | stream->match_maxfwd = 0; | 4348 | stream->match_maxfwd = 0; |
@@ -4365,7 +4366,9 @@ xd3_source_match_setup (xd3_stream *stream, xoff_t srcpos) | |||
4365 | /* Implement srcwin_maxsz, which prevents the encoder from seeking | 4366 | /* Implement srcwin_maxsz, which prevents the encoder from seeking |
4366 | * back further than the LRU cache maintaining FIFO discipline, | 4367 | * back further than the LRU cache maintaining FIFO discipline, |
4367 | * which causes terrible performance. */ | 4368 | * which causes terrible performance. */ |
4368 | if (xd3_source_eof (stream->src) - srcpos > stream->srcwin_maxsz) { | 4369 | frontier_pos = stream->src->frontier_blkno * stream->src->blksize; |
4370 | XD3_ASSERT (frontier_pos >= srcpos); | ||
4371 | if (frontier_pos - srcpos > stream->srcwin_maxsz) { | ||
4369 | IF_DEBUG1(DP(RINT "[match_setup] rejected due to srcwin_maxsz " | 4372 | IF_DEBUG1(DP(RINT "[match_setup] rejected due to srcwin_maxsz " |
4370 | "distance eof=%"Q"u srcpos=%"Q"u maxsz=%u\n", | 4373 | "distance eof=%"Q"u srcpos=%"Q"u maxsz=%u\n", |
4371 | xd3_source_eof (stream->src), | 4374 | xd3_source_eof (stream->src), |