diff options
author | Jaroslav Kysela <perex@perex.cz> | 2022-11-09 08:11:42 +0100 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2022-11-09 08:18:06 +0100 |
commit | aa4f56c3c952269c36464cc0da9db5a1381648fa (patch) | |
tree | 14de682d89f208e7391f3a596e17a57b7967a404 | |
parent | 1b436862ed6253629d79edc2e09826efd4e0f4e3 (diff) | |
download | alsa-lib-aa4f56c3c952269c36464cc0da9db5a1381648fa.tar.gz |
pcm: rate - fix the crash in snd_pcm_rate_may_wait_for_avail_min()
The pcm argument passed to the conversion function in
snd_pcm_plugin_may_wait_for_avail_min_conv() should be
pcm->fast_op_arg.
Test command: arecord -Dplughw:x -r12000 -c2 -fS16_LE -M temp.wav
Fixes: d9dbb57b ("pcm: rate - rewrite the may_wait_for_avail_min callback for the rate plugin")
BugLink: https://lore.kernel.org/alsa-devel/1667793912-18957-1-git-send-email-shengjiu.wang@nxp.com/
Fixes: https://github.com/alsa-project/alsa-lib/issues/282
Reported-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-rw-r--r-- | src/pcm/pcm_plugin.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c index 6bb90b8b..ec64604c 100644 --- a/src/pcm/pcm_plugin.c +++ b/src/pcm/pcm_plugin.c @@ -622,7 +622,7 @@ int snd_pcm_plugin_may_wait_for_avail_min_conv( * This code is also used by extplug, but extplug does not allow to alter the sampling rate. */ if (conv) - needed_slave_avail_min = conv(pcm, needed_slave_avail_min); + needed_slave_avail_min = conv(pcm->fast_op_arg, needed_slave_avail_min); if (slave->avail_min != needed_slave_avail_min) { snd_pcm_sw_params_t *swparams; |