Fixed division by zero in ogg metadata parser and crash when building
tagcache (FS#6099). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11386 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
62a11ea9e6
commit
2891816489
1 changed files with 6 additions and 0 deletions
|
@ -760,6 +760,12 @@ static bool get_vorbis_metadata(int fd, struct mp3entry* id3)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (id3->length <= 0)
|
||||||
|
{
|
||||||
|
logf("ogg length invalid!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
id3->length = (id3->samples / id3->frequency) * 1000;
|
id3->length = (id3->samples / id3->frequency) * 1000;
|
||||||
id3->bitrate = (((int64_t) id3->filesize - comment_size) * 8) / id3->length;
|
id3->bitrate = (((int64_t) id3->filesize - comment_size) * 8) / id3->length;
|
||||||
id3->vbr = true;
|
id3->vbr = true;
|
||||||
|
|
Loading…
Reference in a new issue