summaryrefslogtreecommitdiff
path: root/plugins/artwork/albumartorg.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-05-08 17:44:09 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-05-08 17:44:09 +0200
commit24eeb7ee096fd1066c4b6aa15a67be369958825d (patch)
tree92a11d0f2d5a8a1b3dbca1360d2d66ea6577b020 /plugins/artwork/albumartorg.c
parent40216453411e800a3aa6cc13079c1548c27d0b20 (diff)
fixed possible hangs / errors in artwork plugin
Diffstat (limited to 'plugins/artwork/albumartorg.c')
-rw-r--r--plugins/artwork/albumartorg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/artwork/albumartorg.c b/plugins/artwork/albumartorg.c
index cc10f235..31a0c32f 100644
--- a/plugins/artwork/albumartorg.c
+++ b/plugins/artwork/albumartorg.c
@@ -42,6 +42,7 @@ fetch_from_albumart_org (const char *artist, const char *album, const char *dest
trace ("fetch_from_albumart_org: failed to open %s\n", url);
return -1;
}
+ current_file = fp;
const char searchstr[] = "http://ecx.images-amazon.com/images/I/";
char buffer[10000];
memset (buffer, 0, sizeof (buffer));
@@ -50,6 +51,7 @@ fetch_from_albumart_org (const char *artist, const char *album, const char *dest
if (size > 0) {
img = strstr (buffer, searchstr);
}
+ current_file = NULL;
deadbeef->fclose (fp);
if (!img) {
@@ -70,10 +72,12 @@ fetch_from_albumart_org (const char *artist, const char *album, const char *dest
trace ("fetch_from_albumart_org: failed to open %s\n", img);
return -1;
}
+ current_file = fp;
FILE *out = fopen (dest, "w+b");
if (!out) {
trace ("fetch_from_albumart_org: failed to open %s for writing\n", dest);
+ current_file = NULL;
deadbeef->fclose (fp);
return -1;
}
@@ -90,6 +94,7 @@ fetch_from_albumart_org (const char *artist, const char *album, const char *dest
}
fclose (out);
+ current_file = NULL;
deadbeef->fclose (fp);
if (error) {