forked from len0rd/rockbox
Better handling of garbage in ID3V2 tags
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2090 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
51ca48ba0d
commit
ae17b526ff
1 changed files with 7 additions and 5 deletions
|
@ -159,9 +159,9 @@ static bool setid3v1title(int fd, struct mp3entry *entry)
|
||||||
*/
|
*/
|
||||||
static void setid3v2title(int fd, struct mp3entry *entry)
|
static void setid3v2title(int fd, struct mp3entry *entry)
|
||||||
{
|
{
|
||||||
unsigned int minframesize;
|
int minframesize;
|
||||||
int size;
|
int size;
|
||||||
unsigned int readsize = 0, headerlen;
|
int readsize = 0, headerlen;
|
||||||
char *title = NULL;
|
char *title = NULL;
|
||||||
char *artist = NULL;
|
char *artist = NULL;
|
||||||
char *album = NULL;
|
char *album = NULL;
|
||||||
|
@ -193,7 +193,7 @@ static void setid3v2title(int fd, struct mp3entry *entry)
|
||||||
|
|
||||||
*(buffer + size) = '\0';
|
*(buffer + size) = '\0';
|
||||||
|
|
||||||
/* Set minimun frame size according to ID3v2 version */
|
/* Set minimum frame size according to ID3v2 version */
|
||||||
if(version > 2)
|
if(version > 2)
|
||||||
minframesize = 12;
|
minframesize = 12;
|
||||||
else
|
else
|
||||||
|
@ -218,7 +218,9 @@ static void setid3v2title(int fd, struct mp3entry *entry)
|
||||||
(header[4] << 8) +
|
(header[4] << 8) +
|
||||||
(header[5]);
|
(header[5]);
|
||||||
}
|
}
|
||||||
if(headerlen < 1)
|
|
||||||
|
/* Continue if the frame length seems bad */
|
||||||
|
if(headerlen > size)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Check for certain frame headers */
|
/* Check for certain frame headers */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue