shithub: sox

Download patch

ref: 342d3e71fc197e1dfb45f7dd84ee734ad0a8f79d
parent: 9923bcf0b70bc292f74b69df85c0ef0bff9a3c31
author: Mans Rullgard <mans@mansr.com>
date: Thu Apr 26 15:31:10 EDT 2018

oss: fix input buffer overrun [bug #300]

Each iteration of the write loop should only read the remaining number
of samples, not the full input buffer size.

--- a/src/oss.c
+++ b/src/oss.c
@@ -369,7 +369,7 @@
         size_t cbStride;
         int cbWritten;
 
-        cStride = cInput;
+        cStride = cInputRemaining;
         if (cStride > pPriv->cOutput) {
             cStride = pPriv->cOutput;
         }