summaryrefslogtreecommitdiffstats
path: root/apps/metadata/id3tags.c
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2011-02-22 07:11:11 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2011-02-22 07:11:11 +0000
commit6bc704e92a305a8e11d798725ad57425751e56aa (patch)
tree8d65416a6ca2808af0ee2d87411f19c4141e8945 /apps/metadata/id3tags.c
parent9d66c878e593ab2fad93370d5dbc192c9fbd391f (diff)
downloadrockbox-6bc704e92a305a8e11d798725ad57425751e56aa.tar.gz
rockbox-6bc704e92a305a8e11d798725ad57425751e56aa.tar.bz2
rockbox-6bc704e92a305a8e11d798725ad57425751e56aa.zip
Fix FS#11956. Call parse_replaygain() with correct parameters in ID3 tag parsing.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29375 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/metadata/id3tags.c')
-rw-r--r--apps/metadata/id3tags.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/apps/metadata/id3tags.c b/apps/metadata/id3tags.c
index ba6a158080..3cbebc12e3 100644
--- a/apps/metadata/id3tags.c
+++ b/apps/metadata/id3tags.c
@@ -357,27 +357,32 @@ static int parseuser( struct mp3entry* entry, char* tag, int bufferpos )
{
char* value = NULL;
int desc_len = strlen(tag);
- int value_len = 0;
+ int length = 0;
if ((tag - entry->id3v2buf + desc_len + 2) < bufferpos) {
/* At least part of the value was read, so we can safely try to
* parse it */
value = tag + desc_len + 1;
- value_len = strlen(value) + 1;
if (!strcasecmp(tag, "ALBUM ARTIST")) {
- strlcpy(tag, value, value_len);
+ length = strlen(value) + 1;
+ strlcpy(tag, value, length);
entry->albumartist = tag;
#if CONFIG_CODEC == SWCODEC
} else {
- value_len = parse_replaygain(tag, value, entry, tag, value_len);
-#else
- value_len = 0;
+ /* Calculate residual buffer size in bytes which can be used by
+ * parse_replaygain() to save the string representation of
+ * replaygain data.*/
+ length = sizeof(entry->id3v2buf) - (tag - entry->id3v2buf);
+
+ /* Call parse_replaygain(), returns length in bytes used by the
+ * string representation of replaygain data. */
+ length = parse_replaygain(tag, value, entry, tag, length);
#endif
}
}
- return tag - entry->id3v2buf + value_len;
+ return tag - entry->id3v2buf + length;
}
#if CONFIG_CODEC == SWCODEC