summaryrefslogtreecommitdiff
path: root/apps/codecs/flac.c
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2009-03-29 14:46:11 +0000
committerMagnus Holmgren <magnushol@gmail.com>2009-03-29 14:46:11 +0000
commitefef625b3fa535df9b2469f085cbe1894c5b0202 (patch)
tree65f7c6a9696474f9071c29796c370abdef66be80 /apps/codecs/flac.c
parent59ba832e3aefa3398ab4a509ef139aa9e7926a34 (diff)
Fix FS#10067: Crash when playing very short (less than a second) FLAC files.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20567 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/flac.c')
-rw-r--r--apps/codecs/flac.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/codecs/flac.c b/apps/codecs/flac.c
index 00d2c16993..cc3f683706 100644
--- a/apps/codecs/flac.c
+++ b/apps/codecs/flac.c
@@ -133,7 +133,7 @@ static bool flac_init(FLACContext* fc, int first_frame_offset)
/* Calculate track length (in ms) and estimate the bitrate
(in kbit/s) */
- fc->length = (fc->totalsamples / fc->samplerate) * 1000;
+ fc->length = ((int64_t) fc->totalsamples * 1000) / fc->samplerate;
found_streaminfo=true;
} else if ((buf[0] & 0x7f) == 3) { /* 3 is the SEEKTABLE block */