From 1f2a1e65c0fdd035ccd608f4e7e1f0ff5e1d8cb5 Mon Sep 17 00:00:00 2001 From: Julien BLACHE Date: Fri, 18 Mar 2011 21:19:51 +0100 Subject: [PATCH] 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. --- src/filescanner.c | 6 ++++-- src/filescanner_urlfile.c | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/filescanner.c b/src/filescanner.c index 888d031d..6cfa6f16 100644 --- a/src/filescanner.c +++ b/src/filescanner.c @@ -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)) diff --git a/src/filescanner_urlfile.c b/src/filescanner_urlfile.c index 558473b4..59dd28e4 100644 --- a/src/filescanner_urlfile.c +++ b/src/filescanner_urlfile.c @@ -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; }