ladspa-sink: fix incorrect error conditions
authorSangchul Lee <sangchul1011@gmail.com>
Thu, 3 May 2018 17:00:26 +0000 (02:00 +0900)
committerTanu Kaskinen <tanuk@iki.fi>
Fri, 4 May 2018 14:30:59 +0000 (17:30 +0300)
fix codes to prevent null pointer dereference of cdata variable.

Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
src/modules/module-ladspa-sink.c

index d677381..c365b31 100644 (file)
@@ -718,7 +718,7 @@ static int parse_control_parameters(struct userdata *u, const char *cdata, doubl
 
     pa_log_debug("Trying to read %lu control values", u->n_control);
 
-    if (!cdata && u->n_control > 0)
+    if (!cdata || u->n_control == 0)
         return -1;
 
     pa_log_debug("cdata: '%s'", cdata);