diff options
| author | Miika Pekkarinen <miipekk@ihme.org> | 2006-10-29 20:33:12 +0000 |
|---|---|---|
| committer | Miika Pekkarinen <miipekk@ihme.org> | 2006-10-29 20:33:12 +0000 |
| commit | 28918164891e7870f38994e6e053d52d1a39048e (patch) | |
| tree | 97a46adf71114242f090f95d2caf2535b2b205c4 /apps/metadata.c | |
| parent | 62a11ea9e67760c812bd95eb7c8408295cd93797 (diff) | |
| download | rockbox-28918164891e7870f38994e6e053d52d1a39048e.zip rockbox-28918164891e7870f38994e6e053d52d1a39048e.tar.gz rockbox-28918164891e7870f38994e6e053d52d1a39048e.tar.bz2 rockbox-28918164891e7870f38994e6e053d52d1a39048e.tar.xz | |
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
Diffstat (limited to 'apps/metadata.c')
| -rw-r--r-- | apps/metadata.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/metadata.c b/apps/metadata.c index 9fbf2e1..a4d8ef0 100644 --- a/apps/metadata.c +++ b/apps/metadata.c @@ -760,6 +760,12 @@ static bool get_vorbis_metadata(int fd, struct mp3entry* id3) return false; } + if (id3->length <= 0) + { + logf("ogg length invalid!"); + return false; + } + id3->length = (id3->samples / id3->frequency) * 1000; id3->bitrate = (((int64_t) id3->filesize - comment_size) * 8) / id3->length; id3->vbr = true; |