diff options
author | Magnus Holmgren <magnushol@gmail.com> | 2009-03-29 14:46:11 +0000 |
---|---|---|
committer | Magnus Holmgren <magnushol@gmail.com> | 2009-03-29 14:46:11 +0000 |
commit | efef625b3fa535df9b2469f085cbe1894c5b0202 (patch) | |
tree | 65f7c6a9696474f9071c29796c370abdef66be80 /apps/codecs/flac.c | |
parent | 59ba832e3aefa3398ab4a509ef139aa9e7926a34 (diff) | |
download | rockbox-efef625b3fa535df9b2469f085cbe1894c5b0202.tar.gz rockbox-efef625b3fa535df9b2469f085cbe1894c5b0202.zip |
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.c | 2 |
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) | |||
133 | 133 | ||
134 | /* Calculate track length (in ms) and estimate the bitrate | 134 | /* Calculate track length (in ms) and estimate the bitrate |
135 | (in kbit/s) */ | 135 | (in kbit/s) */ |
136 | fc->length = (fc->totalsamples / fc->samplerate) * 1000; | 136 | fc->length = ((int64_t) fc->totalsamples * 1000) / fc->samplerate; |
137 | 137 | ||
138 | found_streaminfo=true; | 138 | found_streaminfo=true; |
139 | } else if ((buf[0] & 0x7f) == 3) { /* 3 is the SEEKTABLE block */ | 139 | } else if ((buf[0] & 0x7f) == 3) { /* 3 is the SEEKTABLE block */ |