From 8530b62a9be3dfbf82ac124536634f0918b6e775 Mon Sep 17 00:00:00 2001 From: alex Date: Sat, 22 Mar 2003 21:14:51 +0000 Subject: [PATCH] fixed trivial seeking bugs, patch by Krister Lagerstrom git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9657 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/cdda.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libmpdemux/cdda.c b/libmpdemux/cdda.c index 25f0cf24d6..6989ea5451 100644 --- a/libmpdemux/cdda.c +++ b/libmpdemux/cdda.c @@ -182,8 +182,10 @@ int read_cdda(stream_t* s) { s->pos = p->sector*CD_FRAMESIZE_RAW; memcpy(s->buffer,buf,CD_FRAMESIZE_RAW); - if(p->sector == p->end_sector) + if((p->sector < p->start_sector) || (p->sector >= p->end_sector)) { s->eof = 1; + return 0; + } for(i=0;icd->tracks;i++){ if(p->cd->disc_toc[i].dwStartSector==p->sector-1) { @@ -206,6 +208,11 @@ void seek_cdda(stream_t* s) { int sec; int current_track=0, seeked_track=0; int i; + + if(s->pos < 0) { + s->eof = 1; + return; + } sec = s->pos/CD_FRAMESIZE_RAW; //printf("pos: %d, sec: %d ## %d\n", (int)s->pos, (int)sec, CD_FRAMESIZE_RAW);