From d68ecccd8880cbcf98e186d81bcbedbcd0fbedbc Mon Sep 17 00:00:00 2001 From: Cástor Muñoz Date: Tue, 28 Apr 2015 19:38:54 +0200 Subject: 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 --- lib/rbcodec/codecs/mp3_enc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') 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 -- cgit