[scan] Fix access violation if pls line has no '='

This commit is contained in:
ejurgensen 2019-12-27 23:58:57 +01:00
parent 251080344e
commit 8248d2fe9f

View File

@ -327,8 +327,8 @@ scan_playlist(const char *file, time_t mtime, int dir_id)
/* For pls files we are only interested in the part after the FileX= entry */
path = NULL;
if ((pl_format == PLAYLIST_PLS) && (strncasecmp(buf, "file", strlen("file")) == 0))
path = strchr(buf, '=') + 1;
if ((pl_format == PLAYLIST_PLS) && (strncasecmp(buf, "file", strlen("file")) == 0) && (path = strchr(buf, '=')))
path++;
else if (pl_format == PLAYLIST_M3U)
path = buf;