[MPlayer-cvslog] r33516 - trunk/stream/stream_cue.c

reimar subversion at mplayerhq.hu
Sun May 29 13:47:18 CEST 2011


Author: reimar
Date: Sun May 29 13:47:18 2011
New Revision: 33516

Log:
Ensure 0-termination even if line does not start with FILE "

Modified:
   trunk/stream/stream_cue.c

Modified: trunk/stream/stream_cue.c
==============================================================================
--- trunk/stream/stream_cue.c	Sun May 29 13:45:47 2011	(r33515)
+++ trunk/stream/stream_cue.c	Sun May 29 13:47:18 2011	(r33516)
@@ -173,11 +173,11 @@ static int cue_getTrackinfo(FILE *fd_cue
  */
 static int cue_find_bin (const char *firstline) {
   const char *cur_name;
-  int i;
   char bin_filename[256];
   char s[256];
   char t[256];
   int fd_bin;
+  int i = 0;
 
   /* get the filename out of that */
   /*                      12345 6  */
@@ -185,7 +185,6 @@ static int cue_find_bin (const char *fir
   if (strncmp(firstline, "FILE \"",6)==0)
   {
     firstline += 6;
-    i = 0;
     while ( *firstline && *firstline != '"')
     {
       bin_filename[i] = *firstline++;
@@ -205,9 +204,8 @@ static int cue_find_bin (const char *fir
           i++;
       }
     }
-    bin_filename[i] = '\0';
-
   }
+  bin_filename[i] = '\0';
 
   fd_bin = -1;
   for (i = 0; fd_bin == -1 && i < 6; i++) {


More information about the MPlayer-cvslog mailing list