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;