# HG changeset patch # User reimar # Date 1306670171 0 # Node ID 2e2a56ca2d0b28b007e04ce13c321b0d1d09b9f8 # Parent 043d9e61e043065cfb77e16b52fd1dc600bb7833 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. diff -r 043d9e61e043 -r 2e2a56ca2d0b stream/stream_cue.c --- a/stream/stream_cue.c Sun May 29 11:47:18 2011 +0000 +++ b/stream/stream_cue.c Sun May 29 11:56:11 2011 +0000 @@ -172,6 +172,7 @@ * 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 @@ 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);