summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2011-08-26 12:37:13 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2011-08-26 12:37:13 +0000
commite3b3547e20d5f7a634011702ab7a6a5de7d0fea5 (patch)
treebc8ff2e7ca0d596f6495b5d200545fbfe4c4fa6d
parenta33625bd068a99fd41d4d859cba70d682159502a (diff)
downloadrockbox-e3b3547e20d5f7a634011702ab7a6a5de7d0fea5.zip
rockbox-e3b3547e20d5f7a634011702ab7a6a5de7d0fea5.tar.gz
rockbox-e3b3547e20d5f7a634011702ab7a6a5de7d0fea5.tar.bz2
rockbox-e3b3547e20d5f7a634011702ab7a6a5de7d0fea5.tar.xz
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
-rw-r--r--apps/codecs/libfaad/structs.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/codecs/libfaad/structs.h b/apps/codecs/libfaad/structs.h
index c241cc4..a6114f4 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;