Linux bluetooth development
 help / color / mirror / Atom feed
From: "Aurélien Zanelli" <aurelien.zanelli@parrot.com>
To: <linux-bluetooth@vger.kernel.org>
Cc: "Aurélien Zanelli" <aurelien.zanelli@parrot.com>
Subject: [PATCH 2/2] sbc: use an uint16 to store frame length in internal frame structure
Date: Thu, 23 Oct 2014 16:32:21 +0200	[thread overview]
Message-ID: <1414074741-20286-3-git-send-email-aurelien.zanelli@parrot.com> (raw)
In-Reply-To: <1414074741-20286-1-git-send-email-aurelien.zanelli@parrot.com>

Otherwise it could overflow in some cases.
For instance in DUAL_CHANNEL mode, with subbands set to SBC_SB_8, blocks
set to SBC_BLK_16 and bitpool set to 64 results in a frame length of 268.
---
 sbc/sbc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sbc/sbc.c b/sbc/sbc.c
index e830388..606f11c 100644
--- a/sbc/sbc.c
+++ b/sbc/sbc.c
@@ -119,7 +119,7 @@ struct sbc_frame {
 	uint8_t subbands;
 	uint8_t bitpool;
 	uint16_t codesize;
-	uint8_t length;
+	uint16_t length;
 
 	/* bit number x set means joint stereo has been used in subband x */
 	uint8_t joint;
-- 
1.7.10.4


  parent reply	other threads:[~2014-10-23 14:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-23 14:32 [PATCH 0/2] sbc: fix frame length in DUAL_CHANNEL mode Aurélien Zanelli
2014-10-23 14:32 ` [PATCH 1/2] sbc: fix frame length calculation for " Aurélien Zanelli
2014-10-23 14:32 ` Aurélien Zanelli [this message]
2014-10-27 10:41 ` [PATCH 0/2] sbc: fix frame length in " 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=1414074741-20286-3-git-send-email-aurelien.zanelli@parrot.com \
    --to=aurelien.zanelli@parrot.com \
    --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