mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-27 23:55:57 -05:00
Don't retrieve ICY StreamUrls without jpg/png extension (don't want to risk initiating a major, useless download)
This commit is contained in:
parent
227017ef5b
commit
b6703ab7cd
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user