diff --git a/src/stb_vorbis.h b/src/stb_vorbis.h index 8686bdf..7cc39e5 100644 --- a/src/stb_vorbis.h +++ b/src/stb_vorbis.h @@ -5636,6 +5636,7 @@ int stb_vorbis_get_samples_float_interleaved(stb_vorbis *f, int channels, float float **outputs; int len = num_floats / channels; int n=0; + int r=0; int z = f->channels; if (z > channels) z = channels; while (n < len) { @@ -5652,7 +5653,9 @@ int stb_vorbis_get_samples_float_interleaved(stb_vorbis *f, int channels, float f->channel_buffer_start += k; if (n == len) break; - if (!stb_vorbis_get_frame_float(f, NULL, &outputs)) + r = stb_vorbis_get_frame_float(f, NULL, &outputs); + n = n - k + r; + if (!r) break; } f->current_playback_loc += n;