Fixup URL files scanning

Do not proceed and scan the file with ffmpeg on error, bail out. Doing so,
don't free strings allocated inside the mfi as we'll call free_mfi() anyway.

Reported by Kai Elwert.
This commit is contained in:
Julien BLACHE 2011-03-18 21:19:51 +01:00
parent 722c293e4e
commit 1f2a1e65c0
2 changed files with 4 additions and 4 deletions

View File

@ -259,9 +259,11 @@ process_media_file(char *file, time_t mtime, off_t size, int compilation)
if ((strcmp(ext, ".pls") == 0)
|| (strcmp(ext, ".url") == 0))
{
mfi.data_kind = 1; /* url/stream */
ret = scan_url_file(file, &mfi);
if (ret == 0)
mfi.data_kind = 1; /* url/stream */
if (ret < 0)
goto out;
}
else if ((strcmp(ext, ".png") == 0)
|| (strcmp(ext, ".jpg") == 0))

View File

@ -106,8 +106,6 @@ scan_url_file(char *file, struct media_file_info *mfi)
{
DPRINTF(E_WARN, L_SCAN, "Could not read bitrate\n");
free(mfi->title);
free(mfi->url);
return -1;
}