]> git.alsa-project.org Git - alsa-lib.git/commitdiff
ladspa plugin - SIGSEGV fix when label is not specified
authorJaroslav Kysela <perex@perex.cz>
Tue, 13 Dec 2005 14:25:13 +0000 (14:25 +0000)
committerJaroslav Kysela <perex@perex.cz>
Tue, 13 Dec 2005 14:25:13 +0000 (14:25 +0000)
src/pcm/pcm_ladspa.c

index d8cebe51420f1cd77373bb3b4af235b4f9193108..28c3402bc6596bc466f502de154f95c2bd03bf25 100644 (file)
@@ -1100,18 +1100,20 @@ static int snd_pcm_ladspa_check_file(snd_pcm_ladspa_plugin_t * const plugin,
 #else
                                 char *labellocale;
                                 struct lconv *lc;
-                                lc = localeconv ();
-                                labellocale = malloc (strlen (label) + 1);
-                                if (labellocale == NULL)
-                                        return -ENOMEM;
-                                strcpy (labellocale, label);
-                                if (strrchr(labellocale, '.'))
-                                        *strrchr (labellocale, '.') = *lc->decimal_point;
-                                if (strcmp(label, d->Label) && strcmp(labellocale, d->Label)) {
-                                        free(labellocale);
-                                        continue;
+                                if (label != NULL) {
+                                        lc = localeconv ();
+                                        labellocale = malloc (strlen (label) + 1);
+                                        if (labellocale == NULL)
+                                                return -ENOMEM;
+                                        strcpy (labellocale, label);
+                                        if (strrchr(labellocale, '.'))
+                                                *strrchr (labellocale, '.') = *lc->decimal_point;
+                                        if (strcmp(label, d->Label) && strcmp(labellocale, d->Label)) {
+                                                free(labellocale);
+                                                continue;
+                                        }
+                                        free (labellocale);
                                 }
-                                free (labellocale);
 #endif
                                if (ladspa_id > 0 && d->UniqueID != ladspa_id)
                                        continue;