From 88693140beeffa7d96b19e0910f53f8075f4748f Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sun, 6 Mar 2022 00:58:20 +0000 Subject: [PATCH 1/1] dvd-sector-copy.c: Reinterpret the `step' as being beyond the high bound. --- dvd-sector-copy.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.11.0