aboutsummaryrefslogtreecommitdiffstats
path: root/fdk-aac/libSACdec/src/sac_dec_lib.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2024-01-05 19:05:48 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2024-01-05 19:05:48 +0100
commit28ec47d8887f43ba54d79dd6d738aef1ff0ec9b9 (patch)
tree36714366ee8883927f57e096490c209d8317ee99 /fdk-aac/libSACdec/src/sac_dec_lib.cpp
parentc573d3e3cfa9afe42bb3aafae17d527a7f608d55 (diff)
downloadODR-AudioEnc-28ec47d8887f43ba54d79dd6d738aef1ff0ec9b9.tar.gz
ODR-AudioEnc-28ec47d8887f43ba54d79dd6d738aef1ff0ec9b9.tar.bz2
ODR-AudioEnc-28ec47d8887f43ba54d79dd6d738aef1ff0ec9b9.zip
Update fdk-aac to v2.0.3
Diffstat (limited to 'fdk-aac/libSACdec/src/sac_dec_lib.cpp')
-rw-r--r--fdk-aac/libSACdec/src/sac_dec_lib.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/fdk-aac/libSACdec/src/sac_dec_lib.cpp b/fdk-aac/libSACdec/src/sac_dec_lib.cpp
index 57446f8..d30131f 100644
--- a/fdk-aac/libSACdec/src/sac_dec_lib.cpp
+++ b/fdk-aac/libSACdec/src/sac_dec_lib.cpp
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten
+© Copyright 1995 - 2020 Fraunhofer-Gesellschaft zur Förderung der angewandten
Forschung e.V. All rights reserved.
1. INTRODUCTION
@@ -700,9 +700,10 @@ bail:
SACDEC_ERROR mpegSurroundDecoder_Config(
CMpegSurroundDecoder *pMpegSurroundDecoder, HANDLE_FDK_BITSTREAM hBs,
AUDIO_OBJECT_TYPE coreCodec, INT samplingRate, INT frameSize,
- INT stereoConfigIndex, INT coreSbrFrameLengthIndex, INT configBytes,
- const UCHAR configMode, UCHAR *configChanged) {
+ INT numChannels, INT stereoConfigIndex, INT coreSbrFrameLengthIndex,
+ INT configBytes, const UCHAR configMode, UCHAR *configChanged) {
SACDEC_ERROR err = MPS_OK;
+ INT nInputChannels;
SPATIAL_SPECIFIC_CONFIG spatialSpecificConfig;
SPATIAL_SPECIFIC_CONFIG *pSsc =
&pMpegSurroundDecoder->spatialSpecificConfigBackup;
@@ -716,12 +717,18 @@ SACDEC_ERROR mpegSurroundDecoder_Config(
err = SpatialDecParseMps212Config(
hBs, &spatialSpecificConfig, samplingRate, coreCodec,
stereoConfigIndex, coreSbrFrameLengthIndex);
+ nInputChannels = spatialSpecificConfig.nInputChannels;
pSsc = &spatialSpecificConfig;
} else {
err = SpatialDecParseMps212Config(
hBs, &pMpegSurroundDecoder->spatialSpecificConfigBackup,
samplingRate, coreCodec, stereoConfigIndex,
coreSbrFrameLengthIndex);
+ nInputChannels =
+ pMpegSurroundDecoder->spatialSpecificConfigBackup.nInputChannels;
+ }
+ if ((err == MPS_OK) && (numChannels != nInputChannels)) {
+ err = MPS_PARSE_ERROR;
}
break;
case AOT_ER_AAC_ELD:
@@ -731,11 +738,19 @@ SACDEC_ERROR mpegSurroundDecoder_Config(
* into temporarily allocated structure */
err = SpatialDecParseSpecificConfig(hBs, &spatialSpecificConfig,
configBytes, coreCodec);
+ nInputChannels = spatialSpecificConfig.nInputChannels;
pSsc = &spatialSpecificConfig;
} else {
err = SpatialDecParseSpecificConfig(
hBs, &pMpegSurroundDecoder->spatialSpecificConfigBackup,
configBytes, coreCodec);
+ nInputChannels =
+ pMpegSurroundDecoder->spatialSpecificConfigBackup.nInputChannels;
+ }
+ /* check number of channels for channel_configuration > 0 */
+ if ((err == MPS_OK) && (numChannels > 0) &&
+ (numChannels != nInputChannels)) {
+ err = MPS_PARSE_ERROR;
}
break;
default: