From efef625b3fa535df9b2469f085cbe1894c5b0202 Mon Sep 17 00:00:00 2001 From: Magnus Holmgren Date: Sun, 29 Mar 2009 14:46:11 +0000 Subject: 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 --- apps/codecs/flac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps') 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 */ -- cgit v1.2.3