summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--stream/stream_cdda.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/stream/stream_cdda.c b/stream/stream_cdda.c
index 41319c6c59..cf575d35a4 100644
--- a/stream/stream_cdda.c
+++ b/stream/stream_cdda.c
@@ -331,12 +331,12 @@ static int seek(stream_t* s,off_t newpos) {
int i;
s->pos = newpos;
- if(s->pos < 0) {
+ sec = s->pos/CD_FRAMESIZE_RAW;
+ if (s->pos < 0 || sec >= p->end_sector) {
s->eof = 1;
return 0;
}
- sec = s->pos/CD_FRAMESIZE_RAW;
//printf("pos: %d, sec: %d ## %d\n", (int)s->pos, (int)sec, CD_FRAMESIZE_RAW);
//printf("sector: %d new: %d\n", p->sector, sec );