[pulseaudio-commits] r2153 - /branches/prepare-0.9.10/src/modules/module-ladspa-sink.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Thu Mar 27 16:22:58 PDT 2008


Author: lennart
Date: Fri Mar 28 00:22:57 2008
New Revision: 2153

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2153&root=pulseaudio&view=rev
Log:
merge r2092,r2093,r2094,r2152 from trunk

Modified:
    branches/prepare-0.9.10/src/modules/module-ladspa-sink.c

Modified: branches/prepare-0.9.10/src/modules/module-ladspa-sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/prepare-0.9.10/src/modules/module-ladspa-sink.c?rev=2153&root=pulseaudio&r1=2152&r2=2153&view=diff
==============================================================================
--- branches/prepare-0.9.10/src/modules/module-ladspa-sink.c (original)
+++ branches/prepare-0.9.10/src/modules/module-ladspa-sink.c Fri Mar 28 00:22:57 2008
@@ -441,7 +441,7 @@
         use_default = pa_xnew(pa_bool_t, n_control);
         p = 0;
 
-        while ((k = pa_split(cdata, ",", &state))) {
+        while ((k = pa_split(cdata, ",", &state)) && p < n_control) {
             float f;
 
             if (*k == 0) {
@@ -458,13 +458,22 @@
 
             pa_xfree(k);
 
-            if (p >= n_control) {
-                pa_log("Too many control values passed, %lu expected.", n_control);
-                goto fail;
-            }
-
             use_default[p] = FALSE;
             u->control[p++] = f;
+        }
+
+        /* The previous loop doesn't take the last control value into account
+           if it is left empty, so we do it here. */
+        if (*cdata == 0 || cdata[strlen(cdata) - 1] == ',') {
+            if (p < n_control)
+                use_default[p] = TRUE;
+            p++;
+        }
+
+        if (p > n_control || k) {
+            pa_log("Too many control values passed, %lu expected.", n_control);
+            pa_xfree(k);
+            goto fail;
         }
 
         if (p < n_control) {




More information about the pulseaudio-commits mailing list