forked from len0rd/rockbox
read_mp4_tag_string() may return a NULL in the pointer so no code should rely
on the pointer being valid unless the return code is checked. This lead to the year_string being accessed with atoi() even when being NULL => crash. This fixes FS#7937. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15080 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
83ec896586
commit
c61e462ae3
1 changed files with 10 additions and 6 deletions
|
@ -402,16 +402,20 @@ static bool read_mp4_tags(int fd, struct mp3entry* id3,
|
||||||
|
|
||||||
case MP4_cday:
|
case MP4_cday:
|
||||||
read_mp4_tag_string(fd, size, &buffer, &buffer_left,
|
read_mp4_tag_string(fd, size, &buffer, &buffer_left,
|
||||||
&id3->year_string);
|
&id3->year_string);
|
||||||
|
|
||||||
/* Try to parse it as a year, for the benefit of the database.
|
/* Try to parse it as a year, for the benefit of the database.
|
||||||
*/
|
*/
|
||||||
id3->year = atoi(id3->year_string);
|
if(id3->year_string)
|
||||||
|
|
||||||
if (id3->year < 1900)
|
|
||||||
{
|
{
|
||||||
id3->year = 0;
|
id3->year = atoi(id3->year_string);
|
||||||
|
if (id3->year < 1900)
|
||||||
|
{
|
||||||
|
id3->year = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
id3->year = 0;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue