forked from len0rd/rockbox
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
This commit is contained in:
parent
b5562a10c8
commit
dedde47424
2 changed files with 8 additions and 0 deletions
|
|
@ -174,8 +174,10 @@ extern const struct afmt_entry audio_formats[AFMT_NUM_CODECS];
|
|||
|
||||
#if MEMORYSIZE > 2
|
||||
#define ID3V2_BUF_SIZE 900
|
||||
#define ID3V2_MAX_ITEM_SIZE 120
|
||||
#else
|
||||
#define ID3V2_BUF_SIZE 300
|
||||
#define ID3V2_MAX_ITEM_SIZE 60
|
||||
#endif
|
||||
|
||||
enum {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue