From: "Christian Hoene" <hoene@uni-tuebingen.de>
To: <linux-bluetooth@vger.kernel.org>
Subject: Fix for not decoding a too small SBC frame
Date: Mon, 22 Dec 2008 17:16:21 +0100 [thread overview]
Message-ID: <011b01c96450$a0b927e0$e22b77a0$@de> (raw)
[-- Attachment #1: Type: text/plain, Size: 408 bytes --]
Hello,
is it for any good that SBC tries to decode a frame even if it is too small
or missing?
Attached you find a patch.
Greetings
Christian
--------------------------------------------------------
Dr.-Ing. Christian Hoene
Computer Networks and Internet, University of Tübingen
Sand 13, 72076 Tübingen, Germany, Phone +49 7071 2970532
http://net.informatik.uni-tuebingen.de/~hoene
[-- Attachment #2: do_not_decode_frame_that_is_too_small.patch --]
[-- Type: application/octet-stream, Size: 361 bytes --]
diff --git a/sbc/sbc.c b/sbc/sbc.c
index 5411893..263d46a 100644
--- a/sbc/sbc.c
+++ b/sbc/sbc.c
@@ -1196,6 +1196,9 @@ int sbc_decode(sbc_t *sbc, void *input, int input_len, void *output,
if (written)
*written = 0;
+ if (framelen<=0)
+ return framelen;
+
samples = sbc_synthesize_audio(&priv->dec_state, &priv->frame);
ptr = output;
reply other threads:[~2008-12-22 16:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='011b01c96450$a0b927e0$e22b77a0$@de' \
--to=hoene@uni-tuebingen.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox