public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* Fix for not decoding a too small SBC frame
@ 2008-12-22 16:16 Christian Hoene
  0 siblings, 0 replies; only message in thread
From: Christian Hoene @ 2008-12-22 16:16 UTC (permalink / raw)
  To: linux-bluetooth

[-- 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;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-12-22 16:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-22 16:16 Fix for not decoding a too small SBC frame Christian Hoene

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox