shithub: sox

Download patch

ref: b425a2dfa60d7c476bdd2574eebb830c57e905eb
parent: 5fb690d3ae5a2b20173688f1da85c6be550d66c7
author: robs <robs>
date: Sun Apr 12 03:14:33 EDT 2009

fix crash caused by trailing comma

--- a/src/compandt.c
+++ b/src/compandt.c
@@ -140,6 +140,10 @@
 {
   char dummy;     /* To check for extraneous chars. */
 
+  if (!text) {
+    lsx_fail("syntax error trying to read transfer function value");
+    return sox_false;
+  }
   if (!strcmp(text, "-inf"))
     *value = -20 * log10(-(double)SOX_SAMPLE_MIN);
   else if (sscanf(text, "%lf %c", value, &dummy) != 1) {