shithub: sox

Download patch

ref: 45bbdcf9851f0a633928b0fb3398a92e3808fdc7
parent: 2fa015da85767d8b7cd4a55e97485108f7ca32dc
author: rrt <rrt>
date: Thu Apr 26 12:19:55 EDT 2007

Fix wrong constant, and make sure loop will always terminate.

--- a/src/lpc10.c
+++ b/src/lpc10.c
@@ -161,7 +161,7 @@
       lpc->samples = 0;
     }
 
-    while (lpc->samples < LPC10_BITS_IN_COMPRESSED_FRAME)
+    while (nread < len && lpc->samples < LPC10_SAMPLES_PER_FRAME)
       buf[nread++] = SOX_FLOAT_32BIT_TO_SAMPLE(lpc->speech[lpc->samples++], ft->clips);
   }