* Fix a couple bugs with embedded album art error handling.

This commit is contained in:
Justin Maggard 2009-03-07 23:12:45 +00:00
parent 3be66cf1ca
commit 0f4212117c

View File

@ -351,7 +351,7 @@ check_embedded_art(const char * path, const char * image_data, int image_size)
} }
else else
{ {
printf("link failed\n"); DPRINTF(E_WARN, L_METADATA, "Linking %s to %s failed\n", art_path, last_path);
free(art_path); free(art_path);
art_path = NULL; art_path = NULL;
} }
@ -389,11 +389,16 @@ check_embedded_art(const char * path, const char * image_data, int image_size)
fclose(dstfile); fclose(dstfile);
if( nwritten != image_size ) if( nwritten != image_size )
{ {
free(art_path);
remove(art_path); remove(art_path);
free(art_path);
return NULL; return NULL;
} }
} }
if( !art_path )
{
DPRINTF(E_WARN, L_METADATA, "Invalid embedded album art in %s\n", basename((char *)path));
return NULL;
}
DPRINTF(E_DEBUG, L_METADATA, "Found new embedded album art in %s\n", basename((char *)path)); DPRINTF(E_DEBUG, L_METADATA, "Found new embedded album art in %s\n", basename((char *)path));
last_hash = hash; last_hash = hash;
strcpy(last_path, art_path); strcpy(last_path, art_path);