Each iteration of the write loop should only read the remaining number of samples, not the full input buffer size.
Unified · Split
| @@ -369,7 +369,7 @@ static size_t osswrite( · 368 unmodified lines | ||
| 369 | 369 | size_t cbStride; |
| 370 | 370 | int cbWritten; |
| 371 | 371 | |
| 372 | − cStride = cInput; | |
| 372 | + cStride = cInputRemaining; | |
| 373 | 373 | if (cStride > pPriv->cOutput) { |
| 374 | 374 | cStride = pPriv->cOutput; |
| 375 | 375 | } |