From 0f3ddbbd7b44f3c452e5b1d189f389d31a900ec7bd19d67c16b8462db7c2f4f9 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 3 Apr 2014 15:22:24 +0000 Subject: [PATCH] Accepting request 228907 from home:tiwai:branches:multimedia:libs - Backport upstream fixes: 0037-route-Return-NULL-in-case-of-zero-found-channels-in-.patch 0038-route-Fix-invalid-pointer-access.patch 0039-pcm-ladspa-Delay-LADSPA-plugin-activate-call.patch - Remove the temporary fix that has been replaced by the fixes above: 0037-pcm-route-Don-t-handle-no-matching-chmap-as-a-seriou.patch OBS-URL: https://build.opensuse.org/request/show/228907 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa?expand=0&rev=158 --- ...handle-no-matching-chmap-as-a-seriou.patch | 35 ---------------- ...L-in-case-of-zero-found-channels-in-.patch | 34 +++++++++++++++ 0038-route-Fix-invalid-pointer-access.patch | 41 +++++++++++++++++++ ...pa-Delay-LADSPA-plugin-activate-call.patch | 40 ++++++++++++++++++ alsa.changes | 11 +++++ alsa.spec | 6 ++- 6 files changed, 131 insertions(+), 36 deletions(-) delete mode 100644 0037-pcm-route-Don-t-handle-no-matching-chmap-as-a-seriou.patch create mode 100644 0037-route-Return-NULL-in-case-of-zero-found-channels-in-.patch create mode 100644 0038-route-Fix-invalid-pointer-access.patch create mode 100644 0039-pcm-ladspa-Delay-LADSPA-plugin-activate-call.patch diff --git a/0037-pcm-route-Don-t-handle-no-matching-chmap-as-a-seriou.patch b/0037-pcm-route-Don-t-handle-no-matching-chmap-as-a-seriou.patch deleted file mode 100644 index 9066a86..0000000 --- a/0037-pcm-route-Don-t-handle-no-matching-chmap-as-a-seriou.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 5b72e3d5305930bffc300aa4f2545ba95992c144 Mon Sep 17 00:00:00 2001 -From: Takashi Iwai -Date: Tue, 18 Mar 2014 15:23:09 +0100 -Subject: [PATCH] pcm: route: Don't handle no matching chmap as a serious error - -When find_matching_chmap() returns an error for the non-matching -chmap, the caller, snd_pcm_route_open(), also returns an error -although it shouldn't be handled as the fatal error. This results in -the probe error with PulseAudio and it gives no real output in the -end. - -Signed-off-by: Takashi Iwai ---- - src/pcm/pcm_route.c | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/src/pcm/pcm_route.c b/src/pcm/pcm_route.c -index ab17fa78be2c..ac11bdc8adfd 100644 ---- a/src/pcm/pcm_route.c -+++ b/src/pcm/pcm_route.c -@@ -940,10 +940,8 @@ static int find_matching_chmap(snd_pcm_t *spcm, snd_pcm_chmap_t *tt_chmap, - - snd_pcm_free_chmaps(chmaps); - -- if (*found_chmap == NULL) { -+ if (*found_chmap == NULL) - SNDERR("Found no matching channel map"); -- return -EINVAL; -- } - return 0; - } - --- -1.9.0 - diff --git a/0037-route-Return-NULL-in-case-of-zero-found-channels-in-.patch b/0037-route-Return-NULL-in-case-of-zero-found-channels-in-.patch new file mode 100644 index 0000000..fce4a04 --- /dev/null +++ b/0037-route-Return-NULL-in-case-of-zero-found-channels-in-.patch @@ -0,0 +1,34 @@ +From d794af65e97822a29945a21c1cd2a21ea3b8e6b8 Mon Sep 17 00:00:00 2001 +From: David Henningsson +Date: Tue, 18 Mar 2014 23:07:19 +0100 +Subject: [PATCH] route: Return NULL in case of zero found channels in + determine_chmap + +This should fix the problem where the old route syntax can no longer +be opened. + +Signed-off-by: David Henningsson +Signed-off-by: Takashi Iwai +--- + src/pcm/pcm_route.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/pcm/pcm_route.c b/src/pcm/pcm_route.c +index ac11bdc8adfd..a9097caa7303 100644 +--- a/src/pcm/pcm_route.c ++++ b/src/pcm/pcm_route.c +@@ -883,7 +883,10 @@ static int determine_chmap(snd_config_t *tt, snd_pcm_chmap_t **tt_chmap) + } + } + +- ++ if (chmap->channels == 0) { ++ free(chmap); ++ chmap = NULL; ++ } + *tt_chmap = chmap; + return 0; + +-- +1.9.1 + diff --git a/0038-route-Fix-invalid-pointer-access.patch b/0038-route-Fix-invalid-pointer-access.patch new file mode 100644 index 0000000..6b7c878 --- /dev/null +++ b/0038-route-Fix-invalid-pointer-access.patch @@ -0,0 +1,41 @@ +From dbe6d7f86902dbbe2ff276b7a6524c084893772f Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Wed, 19 Mar 2014 10:52:24 +0100 +Subject: [PATCH] route: Fix invalid pointer access + +An uninitialized chmap pointer value is assigned in +_snd_pcm_route_open(). Add NULL initializations appropriately, and +also avoid the possible invalid access of NULL pcmp pointer. + +Signed-off-by: Takashi Iwai +--- + src/pcm/pcm_route.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/pcm/pcm_route.c b/src/pcm/pcm_route.c +index a9097caa7303..599fc3eb48e2 100644 +--- a/src/pcm/pcm_route.c ++++ b/src/pcm/pcm_route.c +@@ -1361,7 +1361,7 @@ int _snd_pcm_route_open(snd_pcm_t **pcmp, const char *name, + int err; + snd_pcm_t *spcm; + snd_config_t *slave = NULL, *sconf; +- snd_pcm_chmap_t *tt_chmap, *chmap; ++ snd_pcm_chmap_t *tt_chmap = NULL, *chmap = NULL; + snd_pcm_format_t sformat = SND_PCM_FORMAT_UNKNOWN; + int schannels = -1; + snd_config_t *tt = NULL; +@@ -1460,8 +1460,9 @@ int _snd_pcm_route_open(snd_pcm_t **pcmp, const char *name, + if (err < 0) { + free(chmap); + snd_pcm_close(spcm); ++ } else { ++ ((snd_pcm_route_t*) (*pcmp)->private_data)->chmap = chmap; + } +- ((snd_pcm_route_t*) (*pcmp)->private_data)->chmap = chmap; + + return err; + } +-- +1.9.1 + diff --git a/0039-pcm-ladspa-Delay-LADSPA-plugin-activate-call.patch b/0039-pcm-ladspa-Delay-LADSPA-plugin-activate-call.patch new file mode 100644 index 0000000..2af0f99 --- /dev/null +++ b/0039-pcm-ladspa-Delay-LADSPA-plugin-activate-call.patch @@ -0,0 +1,40 @@ +From 8dcce52ee09b12d977ea23ccd281a17bdcc5414e Mon Sep 17 00:00:00 2001 +From: Matthias Larisch +Date: Thu, 27 Mar 2014 19:05:10 +0100 +Subject: [PATCH] pcm: ladspa: Delay LADSPA plugin activate call + +Some LADSPA Plugins rely on connected control ports on activate call. +While this is not okay by spec, the spec also encourages the activate +call happening as late as possible. + +Signed-off-by: Matthias Larisch +Signed-off-by: Takashi Iwai +--- + src/pcm/pcm_ladspa.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/pcm/pcm_ladspa.c b/src/pcm/pcm_ladspa.c +index 9ce5242e2359..7d1e3df878b0 100644 +--- a/src/pcm/pcm_ladspa.c ++++ b/src/pcm/pcm_ladspa.c +@@ -645,8 +645,6 @@ static int snd_pcm_ladspa_allocate_instances(snd_pcm_t *pcm, snd_pcm_ladspa_t *l + return -EINVAL; + } + list_add_tail(&instance->list, &plugin->instances); +- if (plugin->desc->activate) +- plugin->desc->activate(instance->handle); + if (plugin->policy == SND_PCM_LADSPA_POLICY_DUPLICATE) { + err = snd_pcm_ladspa_connect_plugin_duplicate(plugin, &plugin->input, &plugin->output, instance, idx); + if (err < 0) { +@@ -664,6 +662,8 @@ static int snd_pcm_ladspa_allocate_instances(snd_pcm_t *pcm, snd_pcm_ladspa_t *l + assert(err >= 0); + err = snd_pcm_ladspa_connect_controls(plugin, &plugin->output, instance); + assert(err >= 0); ++ if (plugin->desc->activate) ++ plugin->desc->activate(instance->handle); + } + err = snd_pcm_ladspa_check_connect(plugin, &plugin->input, &instance->input, depth); + if (err < 0) +-- +1.9.1 + diff --git a/alsa.changes b/alsa.changes index 7869a0c..046cdb1 100644 --- a/alsa.changes +++ b/alsa.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Thu Apr 3 17:10:46 CEST 2014 - tiwai@suse.de + +- Backport upstream fixes: + 0037-route-Return-NULL-in-case-of-zero-found-channels-in-.patch + 0038-route-Fix-invalid-pointer-access.patch + 0039-pcm-ladspa-Delay-LADSPA-plugin-activate-call.patch +- Remove the temporary fix that has been replaced by the fixes + above: + 0037-pcm-route-Don-t-handle-no-matching-chmap-as-a-seriou.patch + ------------------------------------------------------------------- Thu Mar 20 15:04:38 CET 2014 - tiwai@suse.de diff --git a/alsa.spec b/alsa.spec index 7b3e455..20bfe60 100644 --- a/alsa.spec +++ b/alsa.spec @@ -88,7 +88,9 @@ Patch33: 0033-pcm-route-Select-slave-chmap-based-on-ttable-informa.patch Patch34: 0034-conf-Allow-2.1-surround-to-use-different-number-of-c.patch Patch35: 0035-pcm-Wrap-hw_ptr-to-boundary-in-pcm_ioplug.patch Patch36: 0036-src-conf-cards-Add-missing-entry-for-Loopback.conf.patch -Patch37: 0037-pcm-route-Don-t-handle-no-matching-chmap-as-a-seriou.patch +Patch37: 0037-route-Return-NULL-in-case-of-zero-found-channels-in-.patch +Patch38: 0038-route-Fix-invalid-pointer-access.patch +Patch39: 0039-pcm-ladspa-Delay-LADSPA-plugin-activate-call.patch # rest suse patches Patch99: alsa-lib-doxygen-avoid-crash-for-11.3.diff BuildRequires: doxygen @@ -195,6 +197,8 @@ cp %{SOURCE50} src/conf/cards %patch35 -p1 %patch36 -p1 %patch37 -p1 +%patch38 -p1 +%patch39 -p1 %if 0%{?suse_version} == 1130 %patch99 -p1 %endif