[MPlayer-cvslog] r37634 - trunk/gui/util/misc.c

ib subversion at mplayerhq.hu
Tue Feb 9 14:03:08 CET 2016


Author: ib
Date: Tue Feb  9 14:03:08 2016
New Revision: 37634

Log:
Fix cue file analyzer.

Stop further parsing of the current line after either FILE, TRACK, TITLE
or INDEX has been found and parsed.

This also fixes an issue discovered by Coverity with reusing variable l
during FILE name parsing, setting it possibly to NULL.

Modified:
   trunk/gui/util/misc.c

Modified: trunk/gui/util/misc.c
==============================================================================
--- trunk/gui/util/misc.c	Tue Feb  9 12:17:16 2016	(r37633)
+++ trunk/gui/util/misc.c	Tue Feb  9 14:03:08 2016	(r37634)
@@ -161,9 +161,7 @@ plItem **cue_playlist(const char *fname)
             }
 
             isFILE = True;
-        }
-
-        if (strncmp(l, "TRACK ", 6) == 0) {
+        } else if (strncmp(l, "TRACK ", 6) == 0) {
             if (!isFILE)
                 continue;
 
@@ -176,16 +174,12 @@ plItem **cue_playlist(const char *fname)
             item[i]->name = strdup(data);
 
             isTRACK = True;
-        }
-
-        if (strncmp(l, "TITLE ", 6) == 0) {
+        } else if (strncmp(l, "TITLE ", 6) == 0) {
             if (!isTRACK)
                 continue;
 
             item[i]->title = strdup(dequote(l + 6));
-        }
-
-        if (strncmp(l, "INDEX 01 ", 9) == 0) {
+        } else if (strncmp(l, "INDEX 01 ", 9) == 0) {
             if (!isTRACK)
                 continue;
 


More information about the MPlayer-cvslog mailing list