File 0015-pcm_file-fix-SEGFAULT-if-file-option-is-missing-whil.patch of Package alsa

From 1919ee473d9bc6983f11327aef3ae76e923f41be Mon Sep 17 00:00:00 2001
From: Andrey Mazo <mazo@telum.ru>
Date: Sun, 17 Nov 2013 01:11:54 +0400
Subject: [PATCH] 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>
---
 src/pcm/pcm_file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pcm/pcm_file.c b/src/pcm/pcm_file.c
index 59504019d557..3d14090fd2ea 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;
-- 
1.8.4.3