alsa/alsa-lib-meter-plugin-segfault-fix.diff

27 lines
927 B
Diff

commit 73ddcda842935c2aed6dd57d141688fe61985b26
Author: Takashi Iwai <tiwai@suse.de>
Date: Wed Nov 19 16:14:27 2008 +0100
Fix segfault with invalid meter plugin option
snd_pcm_meter_add_scope_conf() may cause a segfault when pcm_scope_type
isn't defined.
Initialize type_conf properly to avoid it.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
diff --git a/src/pcm/pcm_meter.c b/src/pcm/pcm_meter.c
index 0dedb42..83d643a 100644
--- a/src/pcm/pcm_meter.c
+++ b/src/pcm/pcm_meter.c
@@ -603,7 +603,7 @@ static int snd_pcm_meter_add_scope_conf(snd_pcm_t *pcm, const char *name,
snd_config_iterator_t i, next;
const char *id;
const char *lib = NULL, *open_name = NULL, *str = NULL;
- snd_config_t *c, *type_conf;
+ snd_config_t *c, *type_conf = NULL;
int (*open_func)(snd_pcm_t *, const char *,
snd_config_t *, snd_config_t *) = NULL;
snd_pcm_meter_t *meter = pcm->private_data;