diff options
author | Andrey Mazo <mazo@telum.ru> | 2013-11-17 01:11:54 +0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-11-17 10:15:26 +0100 |
commit | 1919ee473d9bc6983f11327aef3ae76e923f41be (patch) | |
tree | 18af75faff5bd117df6cf5ba9126557750669548 | |
parent | ae035b7fe5620fcaf4f5ea33ecabcf93b8e056cd (diff) | |
download | alsa-lib-1919ee473d9bc6983f11327aef3ae76e923f41be.tar.gz |
pcm_file: fix SEGFAULT if file option is missing while infile is not.
Commit 5c5f1358123af69155267463a0b6254ad9cbecc4 requires both file and
infile options to be missing to report a failure.
In fact, only file option is mandatory and should be checked there.
Otherwise, NULL file triggers segfault in
snd_pcm_file_replace_fname() called from
snd_pcm_file_open_output_file().
infile option is optional, so don't report fatal error if it's missing.
Signed-off-by: Andrey Mazo <mazo@telum.ru>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | src/pcm/pcm_file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pcm/pcm_file.c b/src/pcm/pcm_file.c index 59504019..3d14090f 100644 --- a/src/pcm/pcm_file.c +++ b/src/pcm/pcm_file.c @@ -948,7 +948,7 @@ int _snd_pcm_file_open(snd_pcm_t **pcmp, const char *name, err = snd_pcm_slave_conf(root, slave, &sconf, 0); if (err < 0) return err; - if ((!fname || strlen(fname) == 0) && fd < 0 && !ifname) { + if ((!fname || strlen(fname) == 0) && fd < 0) { snd_config_delete(sconf); SNDERR("file is not defined"); return -EINVAL; |