diff options
author | Cástor Muñoz <cmvidal@gmail.com> | 2015-04-28 19:38:54 +0200 |
---|---|---|
committer | Cástor Muñoz <cmvidal@gmail.com> | 2015-07-17 01:03:38 +0200 |
commit | d68ecccd8880cbcf98e186d81bcbedbcd0fbedbc (patch) | |
tree | 6311b3ea166f2ef23f6c3dcf79760d0b0b41b83e /lib/rbcodec | |
parent | ab3581c7ef5dcb315905a555ae0b33f6c833f79d (diff) | |
download | rockbox-d68ecccd8880cbcf98e186d81bcbedbcd0fbedbc.tar.gz 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.c | 4 |
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 | |||
96 | typedef struct | 96 | typedef struct |
97 | { | 97 | { |
98 | int bitpos; /* current bitpos for writing */ | 98 | int bitpos; /* current bitpos for writing */ |
99 | uint32_t bbuf[263]; | 99 | uint32_t bbuf[362]; |
100 | } bf_data; | 100 | } bf_data; |
101 | 101 | ||
102 | struct huffcodetab | 102 | struct huffcodetab |
@@ -129,7 +129,7 @@ static int mdct_freq [576] IBSS_ATTR; /* 2304 Bytes */ | |||
129 | static char mdct_sign [576] IBSS_ATTR; /* 576 Bytes */ | 129 | static char mdct_sign [576] IBSS_ATTR; /* 576 Bytes */ |
130 | static short enc_data [576] IBSS_ATTR; /* 1152 Bytes */ | 130 | static short enc_data [576] IBSS_ATTR; /* 1152 Bytes */ |
131 | static uint32_t scalefac [22] IBSS_ATTR; /* 88 Bytes */ | 131 | static uint32_t scalefac [22] IBSS_ATTR; /* 88 Bytes */ |
132 | static bf_data coded_data IBSS_ATTR; /* 1056 Bytes */ | 132 | static bf_data coded_data IBSS_ATTR; /* 1448 Bytes */ |
133 | static uint8_t band_scale_f[22] IBSS_ATTR; /* 22 Bytes */ | 133 | static uint8_t band_scale_f[22] IBSS_ATTR; /* 22 Bytes */ |
134 | 134 | ||
135 | #ifdef MP3_ENC_COP | 135 | #ifdef MP3_ENC_COP |