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

reimar subversion at mplayerhq.hu
Sun May 29 13:56:12 CEST 2011


Author: reimar
Date: Sun May 29 13:56:11 2011
New Revision: 33517

Log:
Only accept regular files as .bin files for .cue files.
In particular avoids trying to use directories as .bin
when e.g. we failed to extract a filename.

Modified:
   trunk/stream/stream_cue.c

Modified: trunk/stream/stream_cue.c
==============================================================================
--- trunk/stream/stream_cue.c	Sun May 29 13:47:18 2011	(r33516)
+++ trunk/stream/stream_cue.c	Sun May 29 13:56:11 2011	(r33517)
@@ -172,6 +172,7 @@ static int cue_getTrackinfo(FILE *fd_cue
  * sure the sizes are in sync.
  */
 static int cue_find_bin (const char *firstline) {
+  struct stat filestat;
   const char *cur_name;
   char bin_filename[256];
   char s[256];
@@ -246,6 +247,10 @@ static int cue_find_bin (const char *fir
       break;
     }
     fd_bin = open(cur_name, O_RDONLY);
+    if (fstat(fd_bin, &filestat) == -1 || !S_ISREG(filestat.st_mode)) {
+        close(fd_bin);
+        fd_bin = -1;
+    }
     if (fd_bin == -1) {
       mp_msg(MSGT_OPEN,MSGL_STATUS, MSGTR_MPDEMUX_CUEREAD_BinFilenameTested,
             cur_name);


More information about the MPlayer-cvslog mailing list