chiark / gitweb /
dvd-sector-copy.c: Adjust the base position when shifting.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 18 Feb 2022 22:51:28 +0000 (22:51 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 18 Feb 2022 22:51:28 +0000 (22:51 +0000)
Fixes stupid bug.

dvd-sector-copy.c

index a2cf9c689ea81d5cc8cdd9a0d3efaa2533c3d7c7..c336d3d2f60500dd7bfb66c8dd574263b2463d42 100644 (file)
@@ -557,7 +557,7 @@ static ssize_t recovery_read(struct recoverybuf *r,
     } else {
       if (r->end + diff > r->sz) r->end = r->sz - diff;
       rearrange_sectors(r, r->start + diff, r->start, r->end - r->start);
-      r->start += diff; r->end += diff;
+      r->pos -= diff; r->start += diff; r->end += diff;
 #ifdef DEBUG
       show_recovery_buffer_map(r, "shifted up by %"PRIuSEC"", diff);
 #endif
@@ -577,7 +577,7 @@ static ssize_t recovery_read(struct recoverybuf *r,
     } else {
       if (r->start < diff) r->start = diff;
       rearrange_sectors(r, r->start - diff, r->start, r->end - r->start);
-      r->start -= diff; r->end -= diff;
+      r->pos += diff; r->start -= diff; r->end -= diff;
 #ifdef DEBUG
       show_recovery_buffer_map(r, "shifted down by %"PRIuSEC"", diff);
 #endif