From: Mark Wooding Date: Sun, 6 Mar 2022 00:58:20 +0000 (+0000) Subject: dvd-sector-copy.c: Reinterpret the `step' as being beyond the high bound. X-Git-Url: https://git.distorted.org.uk/~mdw/dvdrip/commitdiff_plain/88693140beeffa7d96b19e0910f53f8075f4748f dvd-sector-copy.c: Reinterpret the `step' as being beyond the high bound. --- diff --git a/dvd-sector-copy.c b/dvd-sector-copy.c index f757e49..bed3cf6 100644 --- a/dvd-sector-copy.c +++ b/dvd-sector-copy.c @@ -736,11 +736,11 @@ static ssize_t find_good_sector(secaddr *pos_inout, secaddr end, recovered(bad_lo, end); *pos_inout = end; return (0); } - step = step_factor*(bad_hi - bad_lo); + step = (step_factor - 1)*(bad_hi - bad_lo); if (step < step_min) step = step_min; if (step_max && step > step_max) step = step_max; - if (step > end - bad_lo) step = end - bad_lo; - pos = bad_lo + step - 1; + if (step > end - bad_hi) step = end - bad_hi; + pos = bad_hi + step - 1; want = run_length_wanted(pos, step, end); n = recovery_read(&r, pos, want); #ifdef DEBUG