aboutsummaryrefslogtreecommitdiffstats
path: root/libFDK/src/FDK_qmf_domain.cpp
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2018-05-24 07:24:02 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-05-24 07:24:02 -0700
commit634d4f789cc713fd374db7b9dbcaeb1d89bf2d5e (patch)
tree4f088dbfd47d22d3f90ebcbcf054a26d6e69bdce /libFDK/src/FDK_qmf_domain.cpp
parent57d474b424be58783e7abba469d2f3d800094967 (diff)
parenta4d1f0ad52e2cf6f168d2193216602f52033fc27 (diff)
downloadfdk-aac-634d4f789cc713fd374db7b9dbcaeb1d89bf2d5e.tar.gz
fdk-aac-634d4f789cc713fd374db7b9dbcaeb1d89bf2d5e.tar.bz2
fdk-aac-634d4f789cc713fd374db7b9dbcaeb1d89bf2d5e.zip
FDKv2 ubsan patches
am: a4d1f0ad52 Change-Id: Ic489768836aae6a9b9cab9e866ecc8b21d819368
Diffstat (limited to 'libFDK/src/FDK_qmf_domain.cpp')
-rw-r--r--libFDK/src/FDK_qmf_domain.cpp97
1 files changed, 66 insertions, 31 deletions
diff --git a/libFDK/src/FDK_qmf_domain.cpp b/libFDK/src/FDK_qmf_domain.cpp
index 4b78931..043a372 100644
--- a/libFDK/src/FDK_qmf_domain.cpp
+++ b/libFDK/src/FDK_qmf_domain.cpp
@@ -274,17 +274,28 @@ static int FDK_QmfDomain_AllocatePersistentMemory(HANDLE_FDK_QMF_DOMAIN qd) {
size = gc->nBandsAnalysis * 10;
if (size > 0) {
if (gc->nBandsAnalysis == QMF_DOMAIN_ANALYSIS_QMF_BANDS_16) {
- if (NULL == (qd->QmfDomainIn[ch].pAnaQmfStates = GetAnaQmfStates16(ch)))
- goto bail;
+ if (qd->QmfDomainIn[ch].pAnaQmfStates == NULL) {
+ if (NULL ==
+ (qd->QmfDomainIn[ch].pAnaQmfStates = GetAnaQmfStates16(ch)))
+ goto bail;
+ }
} else if (gc->nBandsAnalysis == QMF_DOMAIN_ANALYSIS_QMF_BANDS_24) {
- if (NULL == (qd->QmfDomainIn[ch].pAnaQmfStates = GetAnaQmfStates24(ch)))
- goto bail;
+ if (qd->QmfDomainIn[ch].pAnaQmfStates == NULL) {
+ if (NULL ==
+ (qd->QmfDomainIn[ch].pAnaQmfStates = GetAnaQmfStates24(ch)))
+ goto bail;
+ }
} else if (gc->nBandsAnalysis == QMF_DOMAIN_ANALYSIS_QMF_BANDS_32) {
- if (NULL == (qd->QmfDomainIn[ch].pAnaQmfStates = GetAnaQmfStates32(ch)))
- goto bail;
+ if (qd->QmfDomainIn[ch].pAnaQmfStates == NULL) {
+ if (NULL ==
+ (qd->QmfDomainIn[ch].pAnaQmfStates = GetAnaQmfStates32(ch)))
+ goto bail;
+ }
} else {
- if (NULL == (qd->QmfDomainIn[ch].pAnaQmfStates = GetAnaQmfStates(ch)))
- goto bail;
+ if (qd->QmfDomainIn[ch].pAnaQmfStates == NULL) {
+ if (NULL == (qd->QmfDomainIn[ch].pAnaQmfStates = GetAnaQmfStates(ch)))
+ goto bail;
+ }
}
} else {
qd->QmfDomainIn[ch].pAnaQmfStates = NULL;
@@ -293,20 +304,36 @@ static int FDK_QmfDomain_AllocatePersistentMemory(HANDLE_FDK_QMF_DOMAIN qd) {
size = gc->nQmfOvTimeSlots + gc->nQmfTimeSlots;
if (size > 0) {
if (gc->nQmfTimeSlots == QMF_DOMAIN_TIMESLOTS_16) {
- if (NULL == (qd->QmfDomainIn[ch].hQmfSlotsReal = GetQmfSlotsReal16(ch)))
- goto bail;
- if (NULL == (qd->QmfDomainIn[ch].hQmfSlotsImag = GetQmfSlotsImag16(ch)))
- goto bail;
+ if (qd->QmfDomainIn[ch].hQmfSlotsReal == NULL) {
+ if (NULL ==
+ (qd->QmfDomainIn[ch].hQmfSlotsReal = GetQmfSlotsReal16(ch)))
+ goto bail;
+ }
+ if (qd->QmfDomainIn[ch].hQmfSlotsImag == NULL) {
+ if (NULL ==
+ (qd->QmfDomainIn[ch].hQmfSlotsImag = GetQmfSlotsImag16(ch)))
+ goto bail;
+ }
} else if (gc->nQmfTimeSlots == QMF_DOMAIN_TIMESLOTS_32) {
- if (NULL == (qd->QmfDomainIn[ch].hQmfSlotsReal = GetQmfSlotsReal32(ch)))
- goto bail;
- if (NULL == (qd->QmfDomainIn[ch].hQmfSlotsImag = GetQmfSlotsImag32(ch)))
- goto bail;
+ if (qd->QmfDomainIn[ch].hQmfSlotsReal == NULL) {
+ if (NULL ==
+ (qd->QmfDomainIn[ch].hQmfSlotsReal = GetQmfSlotsReal32(ch)))
+ goto bail;
+ }
+ if (qd->QmfDomainIn[ch].hQmfSlotsImag == NULL) {
+ if (NULL ==
+ (qd->QmfDomainIn[ch].hQmfSlotsImag = GetQmfSlotsImag32(ch)))
+ goto bail;
+ }
} else {
- if (NULL == (qd->QmfDomainIn[ch].hQmfSlotsReal = GetQmfSlotsReal(ch)))
- goto bail;
- if (NULL == (qd->QmfDomainIn[ch].hQmfSlotsImag = GetQmfSlotsImag(ch)))
- goto bail;
+ if (qd->QmfDomainIn[ch].hQmfSlotsReal == NULL) {
+ if (NULL == (qd->QmfDomainIn[ch].hQmfSlotsReal = GetQmfSlotsReal(ch)))
+ goto bail;
+ }
+ if (qd->QmfDomainIn[ch].hQmfSlotsImag == NULL) {
+ if (NULL == (qd->QmfDomainIn[ch].hQmfSlotsImag = GetQmfSlotsImag(ch)))
+ goto bail;
+ }
}
} else {
qd->QmfDomainIn[ch].hQmfSlotsReal = NULL;
@@ -316,17 +343,23 @@ static int FDK_QmfDomain_AllocatePersistentMemory(HANDLE_FDK_QMF_DOMAIN qd) {
size = gc->nQmfOvTimeSlots * gc->nQmfProcBands * CMPLX_MOD;
if (size > 0) {
if (gc->nQmfOvTimeSlots == QMF_DOMAIN_OV_TIMESLOTS_16) {
- if (NULL ==
- (qd->QmfDomainIn[ch].pOverlapBuffer = GetQmfOverlapBuffer16(ch)))
- goto bail;
+ if (qd->QmfDomainIn[ch].pOverlapBuffer == NULL) {
+ if (NULL ==
+ (qd->QmfDomainIn[ch].pOverlapBuffer = GetQmfOverlapBuffer16(ch)))
+ goto bail;
+ }
} else if (gc->nQmfOvTimeSlots == QMF_DOMAIN_OV_TIMESLOTS_32) {
- if (NULL ==
- (qd->QmfDomainIn[ch].pOverlapBuffer = GetQmfOverlapBuffer32(ch)))
- goto bail;
+ if (qd->QmfDomainIn[ch].pOverlapBuffer == NULL) {
+ if (NULL ==
+ (qd->QmfDomainIn[ch].pOverlapBuffer = GetQmfOverlapBuffer32(ch)))
+ goto bail;
+ }
} else {
- if (NULL ==
- (qd->QmfDomainIn[ch].pOverlapBuffer = GetQmfOverlapBuffer(ch)))
- goto bail;
+ if (qd->QmfDomainIn[ch].pOverlapBuffer == NULL) {
+ if (NULL ==
+ (qd->QmfDomainIn[ch].pOverlapBuffer = GetQmfOverlapBuffer(ch)))
+ goto bail;
+ }
}
} else {
qd->QmfDomainIn[ch].pOverlapBuffer = NULL;
@@ -336,8 +369,10 @@ static int FDK_QmfDomain_AllocatePersistentMemory(HANDLE_FDK_QMF_DOMAIN qd) {
for (ch = 0; ch < gc->nOutputChannels; ch++) {
int size = gc->nBandsSynthesis * 9;
if (size > 0) {
- if (NULL == (qd->QmfDomainOut[ch].pSynQmfStates = GetSynQmfStates(ch)))
- goto bail;
+ if (qd->QmfDomainOut[ch].pSynQmfStates == NULL) {
+ if (NULL == (qd->QmfDomainOut[ch].pSynQmfStates = GetSynQmfStates(ch)))
+ goto bail;
+ }
} else {
qd->QmfDomainOut[ch].pSynQmfStates = NULL;
}