Skip to contentSkip to conversation

Fix for not decoding a too small SBC frame

PATCH Christian Hoene 1 participant 1 message Dec 22, 2008 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

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

sbc/sbc.c +3 -0
index 5411893..263d46a 100644
@@ -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;