summaryrefslogtreecommitdiffstats
path: root/lib/rbcodec
diff options
context:
space:
mode:
authorCástor Muñoz <cmvidal@gmail.com>2015-04-28 19:38:54 +0200
committerCástor Muñoz <cmvidal@gmail.com>2015-07-17 01:03:38 +0200
commitd68ecccd8880cbcf98e186d81bcbedbcd0fbedbc (patch)
tree6311b3ea166f2ef23f6c3dcf79760d0b0b41b83e /lib/rbcodec
parentab3581c7ef5dcb315905a555ae0b33f6c833f79d (diff)
downloadrockbox-d68ecccd8880cbcf98e186d81bcbedbcd0fbedbc.tar.gz
rockbox-d68ecccd8880cbcf98e186d81bcbedbcd0fbedbc.tar.bz2
rockbox-d68ecccd8880cbcf98e186d81bcbedbcd0fbedbc.zip
mp3_enc.c: fix MP3 recording at 32 kHz sample rate
Fixes a buffer overflow present when MP3 is encoded at 32000 Hz sample rate, affected bitrates are 320 and 256 kbps. Change-Id: I7634e70409be9d675d47be316a42630dd3147636
Diffstat (limited to 'lib/rbcodec')
-rw-r--r--lib/rbcodec/codecs/mp3_enc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rbcodec/codecs/mp3_enc.c b/lib/rbcodec/codecs/mp3_enc.c
index 45bc3892c5..030eda846e 100644
--- a/lib/rbcodec/codecs/mp3_enc.c
+++ b/lib/rbcodec/codecs/mp3_enc.c
@@ -96,7 +96,7 @@ typedef struct
typedef struct
{
int bitpos; /* current bitpos for writing */
- uint32_t bbuf[263];
+ uint32_t bbuf[362];
} bf_data;
struct huffcodetab
@@ -129,7 +129,7 @@ static int mdct_freq [576] IBSS_ATTR; /* 2304 Bytes */
static char mdct_sign [576] IBSS_ATTR; /* 576 Bytes */
static short enc_data [576] IBSS_ATTR; /* 1152 Bytes */
static uint32_t scalefac [22] IBSS_ATTR; /* 88 Bytes */
-static bf_data coded_data IBSS_ATTR; /* 1056 Bytes */
+static bf_data coded_data IBSS_ATTR; /* 1448 Bytes */
static uint8_t band_scale_f[22] IBSS_ATTR; /* 22 Bytes */
#ifdef MP3_ENC_COP