mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-24 06:50:20 +01:00
Fixed divide by zero error in weird loop cases
This commit is contained in:
parent
91867c0732
commit
a41128c6ad
@ -195,7 +195,7 @@ void input_vgmstream::decode_seek(double p_seconds,abort_callback & p_abort) {
|
||||
int max_buffer_samples = sizeof(sample_buffer)/sizeof(sample_buffer[0])/vgmstream->channels;
|
||||
|
||||
// adjust for correct position within loop
|
||||
if(vgmstream->loop_flag && seek_pos_samples >= vgmstream->loop_end_sample) {
|
||||
if(vgmstream->loop_flag && (vgmstream->loop_end_sample - vgmstream->loop_start_sample) && seek_pos_samples >= vgmstream->loop_end_sample) {
|
||||
seek_pos_samples -= vgmstream->loop_start_sample;
|
||||
seek_pos_samples %= (vgmstream->loop_end_sample - vgmstream->loop_start_sample);
|
||||
seek_pos_samples += vgmstream->loop_start_sample;
|
||||
|
Loading…
Reference in New Issue
Block a user