From b6703ab7cded92d331cc475f9933fb0525780c39 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Sat, 20 Jun 2015 23:11:18 +0200 Subject: [PATCH] Don't retrieve ICY StreamUrls without jpg/png extension (don't want to risk initiating a major, useless download) --- src/artwork.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/artwork.c b/src/artwork.c index 65875a23..c454eebd 100644 --- a/src/artwork.c +++ b/src/artwork.c @@ -684,6 +684,7 @@ artwork_get_player_image(struct evbuffer *evbuf, char *path) struct keyval *kv; const char *content_type; char *url; + char *ext; int format; int id; int len; @@ -704,6 +705,12 @@ artwork_get_player_image(struct evbuffer *evbuf, char *path) if ((len < 14) || (len > PATH_MAX)) // Can't be shorter than http://a/1.jpg goto out_url; + ext = strrchr(url, '.'); + if (!ext) + goto out_url; + if ((strcmp(ext, ".jpg") != 0) && (strcmp(ext, ".png") != 0)) + goto out_url; + cache_artwork_read(evbuf, url, &format); if (format > 0) goto out_url;