mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-03 17:33:05 +00:00
Reduce chance for overflows in VorbisTrackInfo::play
svn-id: r25793
This commit is contained in:
parent
8ce7566c8d
commit
82ae8daccf
@ -341,9 +341,10 @@ void VorbisTrackInfo::play(Audio::Mixer *mixer, Audio::SoundHandle *handle, int
|
||||
return;
|
||||
}
|
||||
|
||||
// Convert startFrame & duration from frames (1/75 s) to milliseconds (1/1000s)
|
||||
uint start = startFrame * 1000 / 75;
|
||||
uint end = duration ? ((startFrame + duration) * 1000 / 75) : 0;
|
||||
// Convert startFrame & duration from frames (1/75 s) to milliseconds (1/1000s),
|
||||
// i.e. multiple with a factor of 1000/75 = 40/3
|
||||
uint start = startFrame * 40 / 3;
|
||||
uint end = duration ? ((startFrame + duration) * 40 / 3) : 0;
|
||||
|
||||
// ... create an AudioStream ...
|
||||
VorbisInputStream *input = new VorbisInputStream(file, true, start, end);
|
||||
|
Loading…
x
Reference in New Issue
Block a user