]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
imagecache: deescape also file:// urls, fixes #3439
authorJaroslav Kysela <perex@perex.cz>
Sat, 26 Dec 2015 16:35:40 +0000 (17:35 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sat, 26 Dec 2015 16:36:21 +0000 (17:36 +0100)
src/imagecache.c

index 3c6879ef3ad00048937eecbd77ad744dd6ae8e3b..f9a04faf23ce8341885026d95b88a230628a94f0 100644 (file)
@@ -16,6 +16,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#define _GNU_SOURCE
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <fcntl.h>
@@ -637,6 +638,7 @@ int
 imagecache_open ( uint32_t id )
 {
   imagecache_image_t skel, *i;
+  char *fn;
   int fd = -1;
 
   lock_assert(&global_lock);
@@ -647,8 +649,11 @@ imagecache_open ( uint32_t id )
     return -1;
 
   /* Local file */
-  if (!strncasecmp(i->url, "file://", 7))
-    fd = open(i->url + 7, O_RDONLY);
+  if (!strncasecmp(i->url, "file://", 7)) {
+    fn = strdupa(i->url + 7);
+    http_deescape(fn);
+    fd = open(fn, O_RDONLY);
+  }
 
   /* Remote file */
 #if ENABLE_IMAGECACHE