From 9b6c5e2d5c3119dbb79fc70ac8355424a8893ed0 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 13 Mar 2019 14:22:22 +0100 Subject: [PATCH] aplay: check the return value for snd_pcm_sw_params_current() (coverity) Signed-off-by: Jaroslav Kysela --- aplay/aplay.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/aplay/aplay.c b/aplay/aplay.c index 8bdf45b..5b3a766 100644 --- a/aplay/aplay.c +++ b/aplay/aplay.c @@ -1411,7 +1411,11 @@ static void set_params(void) chunk_size, buffer_size); prg_exit(EXIT_FAILURE); } - snd_pcm_sw_params_current(handle, swparams); + err = snd_pcm_sw_params_current(handle, swparams); + if (err < 0) { + error(_("Unable to get current sw params.")); + prg_exit(EXIT_FAILURE); + } if (avail_min < 0) n = chunk_size; else