From: "Pali Rohár" <pali@kernel.org>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH] sbcenc: Add missing error check for unsupported sample rates
Date: Sat, 8 Aug 2020 21:30:14 +0200 [thread overview]
Message-ID: <20200808193014.28951-1-pali@kernel.org> (raw)
Signed-off-by: Pali Rohár <pali@kernel.org>
---
src/sbcenc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/sbcenc.c b/src/sbcenc.c
index dabdff4..2a4c240 100644
--- a/src/sbcenc.c
+++ b/src/sbcenc.c
@@ -105,6 +105,10 @@ static void encode(char *filename, int subbands, int bitpool, int joint,
case 48000:
sbc.frequency = SBC_FREQ_48000;
break;
+ default:
+ fprintf(stderr, "Unsupported sample rate %ukHz\n",
+ BE_INT(au_hdr.sample_rate));
+ goto done;
}
srate = BE_INT(au_hdr.sample_rate);
--
2.20.1
next reply other threads:[~2020-08-08 19:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-08 19:30 Pali Rohár [this message]
2020-08-11 18:30 ` [PATCH] sbcenc: Add missing error check for unsupported sample rates Luiz Augusto von Dentz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200808193014.28951-1-pali@kernel.org \
--to=pali@kernel.org \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.