summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-12-27 22:09:51 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-12-27 22:09:51 +0100
commitfdeb98597d4aa2c222df72691ba1cae2a70ceb74 (patch)
treeb1fba9e6139507ade62bc09ed244e0acc8bcdeb7
parenteec17fe051e1b2baac8d5755f2feb9bff2358640 (diff)
downloadfdk-aac-fdeb98597d4aa2c222df72691ba1cae2a70ceb74.tar.gz
fdk-aac-fdeb98597d4aa2c222df72691ba1cae2a70ceb74.tar.bz2
fdk-aac-fdeb98597d4aa2c222df72691ba1cae2a70ceb74.zip
Add some asserts to FDK
-rw-r--r--libAACenc/src/dyn_bits.cpp2
-rw-r--r--libFDK/src/mdct.cpp3
-rw-r--r--libSBRenc/src/env_est.cpp1
3 files changed, 6 insertions, 0 deletions
diff --git a/libAACenc/src/dyn_bits.cpp b/libAACenc/src/dyn_bits.cpp
index 0c07109..3105fb4 100644
--- a/libAACenc/src/dyn_bits.cpp
+++ b/libAACenc/src/dyn_bits.cpp
@@ -416,6 +416,8 @@ static void FDKaacEnc_noiselessCounter(
break;
}
+ FDK_ASSERT(sideInfoTab != NULL);
+
sectionData->noOfSections = 0;
sectionData->huffmanBits = 0;
sectionData->sideInfoBits = 0;
diff --git a/libFDK/src/mdct.cpp b/libFDK/src/mdct.cpp
index 9a29aa1..9347a16 100644
--- a/libFDK/src/mdct.cpp
+++ b/libFDK/src/mdct.cpp
@@ -119,6 +119,9 @@ void imdct_gain(FIXP_DBL *pGain_m, int *pGain_e, int tl)
gain_e += -MDCT_OUTPUT_GAIN - log2_tl - MDCT_OUT_HEADROOM + 1;
+ FDK_ASSERT(log2_tl - 2 >= 0);
+ FDK_ASSERT(log2_tl - 2 < 8*sizeof(int));
+
/* Detect non-radix 2 transform length and add amplitude compensation factor
which cannot be included into the exponent above */
switch ( (tl) >> (log2_tl - 2) ) {
diff --git a/libSBRenc/src/env_est.cpp b/libSBRenc/src/env_est.cpp
index 929f229..7dbf250 100644
--- a/libSBRenc/src/env_est.cpp
+++ b/libSBRenc/src/env_est.cpp
@@ -1005,6 +1005,7 @@ FDKsbrEnc_extractSbrEnvelope2 (
SBR_STEREO_MODE stereoMode = h_con->stereoMode;
int nChannels = h_con->nChannels;
+ FDK_ASSERT(nChannels < MAX_NUM_CHANNELS);
const int *v_tuning;
static const int v_tuningHEAAC[6] = { 0, 2, 4, 0, 0, 0 };