[MPlayer-cvslog] r30810 - trunk/stream/stream_cue.c
reimar
subversion at mplayerhq.hu
Mon Mar 1 21:20:13 CET 2010
Author: reimar
Date: Mon Mar 1 21:20:13 2010
New Revision: 30810
Log:
Ensure that cue_current_pos.track is not set to an invalid value after
attempting to seek to e.g. track 0.
Modified:
trunk/stream/stream_cue.c
Modified: trunk/stream/stream_cue.c
==============================================================================
--- trunk/stream/stream_cue.c Mon Mar 1 21:11:11 2010 (r30809)
+++ trunk/stream/stream_cue.c Mon Mar 1 21:20:13 2010 (r30810)
@@ -439,15 +439,14 @@ static int cue_read_cue (char *in_cue_fi
-static int cue_read_toc_entry(void) {
-
- int track = cue_current_pos.track - 1;
-
+static int cue_read_toc_entry(int track) {
/* check if its a valid track, if not return -1 */
- if (track < 0 || track >= nTracks)
+ if (track <= 0 || track > nTracks)
return -1;
+ cue_current_pos.track = track;
+ track--;
switch (tracks[track].mode)
{
case AUDIO:
@@ -470,9 +469,7 @@ static int cue_read_toc_entry(void) {
}
static int cue_vcd_seek_to_track (int track){
- cue_current_pos.track = track;
-
- if (cue_read_toc_entry ())
+ if (cue_read_toc_entry (track))
return -1;
return VCD_SECTOR_DATA * cue_get_msf();
More information about the MPlayer-cvslog
mailing list