changeset 34372:622b7e95695a

Fail if trying to seek beyond the last chapter, not just if it is beyond the end of the disc.
author reimar
date Fri, 23 Dec 2011 19:00:31 +0000
parents a4dd7151526b
children 7a4dbec9415b
files stream/stream_cdda.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/stream/stream_cdda.c	Fri Dec 23 16:44:23 2011 +0000
+++ b/stream/stream_cdda.c	Fri Dec 23 19:00:31 2011 +0000
@@ -254,9 +254,10 @@
       int r;
       unsigned int track = *(unsigned int *)arg;
       int start_track = get_track_by_sector(p, p->start_sector);
+      int end_track = get_track_by_sector(p, p->end_sector);
       int seek_sector;
       track += start_track;
-      if (track >= p->cd->tracks) {
+      if (track > end_track) {
         stream->eof = 1;
         return STREAM_ERROR;
       }