From e3b3547e20d5f7a634011702ab7a6a5de7d0fea5 Mon Sep 17 00:00:00 2001 From: Andree Buschmann Date: Fri, 26 Aug 2011 12:37:13 +0000 Subject: Fix an issue in libfaad found by static code analysis. Two arrays within the drc_info structure require a size of 64 due to the related implementation. This code section would not have been called as the decoder checks the number of channels and rejects decoding for files using more than MAX_CHANNELS (2). Closes FS#12245. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30356 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libfaad/structs.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/codecs/libfaad/structs.h b/apps/codecs/libfaad/structs.h index c241cc41f3..a6114f412a 100644 --- a/apps/codecs/libfaad/structs.h +++ b/apps/codecs/libfaad/structs.h @@ -45,6 +45,8 @@ extern "C" { #define MAX_LTP_SFB_S 8 #define FRAME_LEN 1024 +#define DRC_MAX_CHANNELS 64 /* Should be the same as MAX_CHANNELS, but the DRC code expects 64 */ + /* used to save the prediction state */ typedef struct { int16_t r[2]; @@ -91,8 +93,8 @@ typedef struct uint8_t prog_ref_level; uint8_t dyn_rng_sgn[17]; uint8_t dyn_rng_ctl[17]; - uint8_t exclude_mask[MAX_CHANNELS]; - uint8_t additional_excluded_chns[MAX_CHANNELS]; + uint8_t exclude_mask[DRC_MAX_CHANNELS]; + uint8_t additional_excluded_chns[DRC_MAX_CHANNELS/7]; real_t ctrl1; real_t ctrl2; -- cgit v1.2.3