summaryrefslogtreecommitdiffstats
path: root/apps/metadata/id3tags.c
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2011-01-30 20:23:55 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2011-01-30 20:23:55 +0000
commitdedde474248d1e75396b9e90e141284901e588f1 (patch)
tree5769e00fd7f808b94adfdefdb2664b3faffcf002 /apps/metadata/id3tags.c
parentb5562a10c8fe37833183be472d46301d56e7b36f (diff)
downloadrockbox-dedde474248d1e75396b9e90e141284901e588f1.tar.gz
rockbox-dedde474248d1e75396b9e90e141284901e588f1.tar.bz2
rockbox-dedde474248d1e75396b9e90e141284901e588f1.zip
Limit the size of each ID3 metadata item to avoid that the metadata buffer is filled by single items. Fixes FS#11875, FS#9805 and FS#9299.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29174 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/metadata/id3tags.c')
-rw-r--r--apps/metadata/id3tags.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/metadata/id3tags.c b/apps/metadata/id3tags.c
index f3ddd73077..75056a273c 100644
--- a/apps/metadata/id3tags.c
+++ b/apps/metadata/id3tags.c
@@ -836,6 +836,12 @@ void setid3v2title(int fd, struct mp3entry *entry)
if(framelen >= buffersize - bufferpos)
framelen = buffersize - bufferpos - 1;
+ /* Limit the maximum length of an id3 data item to ID3V2_MAX_ITEM_SIZE
+ bytes. This reduces the chance that the available buffer is filled
+ by single metadata items like large comments. */
+ if (ID3V2_MAX_ITEM_SIZE < framelen)
+ framelen = ID3V2_MAX_ITEM_SIZE;
+
logf("id3v2 frame: %.4s", header);
/* Check for certain frame headers