summaryrefslogtreecommitdiffstats
path: root/ext/ladspa
diff options
context:
space:
mode:
authorBrian Cameron <brian.cameron@sun.com>2009-01-08 17:57:19 +0000
committerWim Taymans <wim.taymans@gmail.com>2009-01-08 17:57:19 +0000
commitc266d310af98e5f208929293476457fbca807742 (patch)
treebbafd4e4c8bd2440fe727267262e80f5f9cbd99d /ext/ladspa
parent672051c5eb79ca9acaa6f2d056322d2ad0f3ea31 (diff)
downloadgst-plugins-bad-c266d310af98e5f208929293476457fbca807742.tar.gz
gst-plugins-bad-c266d310af98e5f208929293476457fbca807742.tar.bz2
gst-plugins-bad-c266d310af98e5f208929293476457fbca807742.zip
ext/ladspa/search.c: Avoid searching (null) paths or crashing on platforms where printing a
Original commit message from CVS: Based on Patch by: Brian Cameron <brian dot cameron at sun dot com> * ext/ladspa/search.c: (LADSPAPluginSearch): Avoid searching (null) paths or crashing on platforms where printing a NULL string segfaults. Fixes #567004.
Diffstat (limited to 'ext/ladspa')
-rw-r--r--ext/ladspa/search.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/ladspa/search.c b/ext/ladspa/search.c
index 99e093a4..0b932140 100644
--- a/ext/ladspa/search.c
+++ b/ext/ladspa/search.c
@@ -98,13 +98,19 @@ LADSPAPluginSearch (LADSPAPluginSearchCallbackFunction fCallbackFunction)
const char *pcEnd;
const char *pcLADSPAPath;
const char *pcStart;
+ char *search_path;
/* thomasvs: I'm sorry, but I'm going to add glib stuff here.
* I'm appending logical values for LADSPA_PATH here
*/
- pcLADSPAPath = g_strdup_printf ("%s:/usr/lib/ladspa:/usr/local/lib/ladspa",
- getenv ("LADSPA_PATH"));
+ search_path = getenv ("LADSPA_PATH");
+ if (search_path) {
+ pcLADSPAPath = g_strdup_printf ("%s:/usr/lib/ladspa:/usr/local/lib/ladspa",
+ search_path);
+ } else {
+ pcLADSPAPath = g_strdup ("/usr/lib/ladspa:/usr/local/lib/ladspa");
+ }
if (!pcLADSPAPath) {
/* fprintf(stderr, */