1
0
Fork 0
forked from len0rd/rockbox

Fix id3v2 album art if more than one image is present.

Rockbox only uses the first album art image (APIC / PIC frame) found in id3v2
tags. When a file contains more than one image the second one is ignored but
the parsealbumart() callback overwrites the already set data. This causes the
metadata structure to contain an invalid pointer to the image data, resulting
in no image shown.

Make parsealbumart() aware of this and skip parsing when an albumart image has
already been found. Fixes FS#12870.

Change-Id: Id8164f319cd5e1ee868b581f8f4ad3ea69c17f77
This commit is contained in:
Dominik Riebeling 2013-06-15 20:56:13 +02:00
parent 084c75e5f9
commit b6ddbc41a5

View file

@ -299,7 +299,10 @@ static int parsegenre( struct mp3entry* entry, char* tag, int bufferpos )
/* parse embed albumart */
static int parsealbumart( struct mp3entry* entry, char* tag, int bufferpos )
{
entry->has_embedded_albumart = false;
/* don't parse albumart if already one found. This callback function is
* called unconditionally. */
if(entry->has_embedded_albumart)
return bufferpos;
/* we currently don't support unsynchronizing albumart */
if (entry->albumart.type == AA_TYPE_UNSYNC)
@ -735,6 +738,10 @@ void setid3v2title(int fd, struct mp3entry *entry)
bool itunes_gapless = false;
#endif
#ifdef HAVE_ALBUMART
entry->has_embedded_albumart = false;
#endif
global_ff_found = false;
/* Bail out if the tag is shorter than 10 bytes */