summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/metadata.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/metadata.c b/apps/metadata.c
index 9fbf2e19cd..a4d8ef0f64 100644
--- a/apps/metadata.c
+++ b/apps/metadata.c
@@ -760,6 +760,12 @@ static bool get_vorbis_metadata(int fd, struct mp3entry* id3)
760 return false; 760 return false;
761 } 761 }
762 762
763 if (id3->length <= 0)
764 {
765 logf("ogg length invalid!");
766 return false;
767 }
768
763 id3->length = (id3->samples / id3->frequency) * 1000; 769 id3->length = (id3->samples / id3->frequency) * 1000;
764 id3->bitrate = (((int64_t) id3->filesize - comment_size) * 8) / id3->length; 770 id3->bitrate = (((int64_t) id3->filesize - comment_size) * 8) / id3->length;
765 id3->vbr = true; 771 id3->vbr = true;