[MPlayer-cvslog] r34495 - trunk/stream/stream_cdda.c

ib subversion at mplayerhq.hu
Tue Jan 3 21:47:36 CET 2012


Author: ib
Date: Tue Jan  3 21:47:36 2012
New Revision: 34495

Log:
Add checks for errors in stream_cdda's get_track_by_sector().

Modified:
   trunk/stream/stream_cdda.c

Modified: trunk/stream/stream_cdda.c
==============================================================================
--- trunk/stream/stream_cdda.c	Tue Jan  3 17:17:21 2012	(r34494)
+++ trunk/stream/stream_cdda.c	Tue Jan  3 21:47:36 2012	(r34495)
@@ -252,6 +252,7 @@ static int control(stream_t *stream, int
     {
       int start_track = get_track_by_sector(p, p->start_sector);
       int end_track = get_track_by_sector(p, p->end_sector);
+      if (start_track == -1 || end_track == -1) return STREAM_ERROR;
       *(unsigned int *)arg = end_track + 1 - start_track;
       return STREAM_OK;
     }
@@ -262,6 +263,7 @@ static int control(stream_t *stream, int
       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;
+      if (start_track == -1 || end_track == -1) return STREAM_ERROR;
       track += start_track;
       if (track > end_track) {
         seek(stream, (p->end_sector + 1) * CD_FRAMESIZE_RAW);
@@ -278,6 +280,7 @@ static int control(stream_t *stream, int
     {
       int start_track = get_track_by_sector(p, p->start_sector);
       int cur_track = get_track_by_sector(p, p->sector);
+      if (start_track == -1 || cur_track == -1) return STREAM_ERROR;
       *(unsigned int *)arg = cur_track - start_track;
       return STREAM_OK;
     }


More information about the MPlayer-cvslog mailing list