mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-30 09:03:23 -05:00
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:
parent
722c293e4e
commit
1f2a1e65c0
@ -259,9 +259,11 @@ process_media_file(char *file, time_t mtime, off_t size, int compilation)
|
|||||||
if ((strcmp(ext, ".pls") == 0)
|
if ((strcmp(ext, ".pls") == 0)
|
||||||
|| (strcmp(ext, ".url") == 0))
|
|| (strcmp(ext, ".url") == 0))
|
||||||
{
|
{
|
||||||
|
mfi.data_kind = 1; /* url/stream */
|
||||||
|
|
||||||
ret = scan_url_file(file, &mfi);
|
ret = scan_url_file(file, &mfi);
|
||||||
if (ret == 0)
|
if (ret < 0)
|
||||||
mfi.data_kind = 1; /* url/stream */
|
goto out;
|
||||||
}
|
}
|
||||||
else if ((strcmp(ext, ".png") == 0)
|
else if ((strcmp(ext, ".png") == 0)
|
||||||
|| (strcmp(ext, ".jpg") == 0))
|
|| (strcmp(ext, ".jpg") == 0))
|
||||||
|
@ -106,8 +106,6 @@ scan_url_file(char *file, struct media_file_info *mfi)
|
|||||||
{
|
{
|
||||||
DPRINTF(E_WARN, L_SCAN, "Could not read bitrate\n");
|
DPRINTF(E_WARN, L_SCAN, "Could not read bitrate\n");
|
||||||
|
|
||||||
free(mfi->title);
|
|
||||||
free(mfi->url);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user