Fix an edge case in the data converter.

This commit is contained in:
David Reid
2026-02-20 09:18:25 +10:00
parent a3fd69624b
commit 0e2c0e1eac
+1 -1
View File
@@ -65328,7 +65328,7 @@ static ma_result ma_data_converter_process_pcm_frames__resample_first(ma_data_co
*/
#if 1
{
ma_uint64 requiredInputFrameCount = (frameCountOutThisIteration * pConverter->resampler.sampleRateIn) / pConverter->resampler.sampleRateOut;
ma_uint64 requiredInputFrameCount = ((frameCountOutThisIteration * pConverter->resampler.sampleRateIn) / pConverter->resampler.sampleRateOut) + 1; /* +1 to account for truncation from the division. */
if (frameCountInThisIteration > requiredInputFrameCount) {
frameCountInThisIteration = requiredInputFrameCount;
}