diff options
author | Fraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de> | 2018-06-08 18:04:02 +0200 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2018-10-12 12:02:30 -0400 |
commit | 9db742a7d3f064cfc730e15ae8d3fe6bb7138644 (patch) | |
tree | abda81487d95eb6c733c3aec81b8a7c4b3322d3f /libAACdec | |
parent | 78f80da872c305122f0a439402cc069d8b3b0a5c (diff) | |
download | fdk-aac-9db742a7d3f064cfc730e15ae8d3fe6bb7138644.tar.gz fdk-aac-9db742a7d3f064cfc730e15ae8d3fe6bb7138644.tar.bz2 fdk-aac-9db742a7d3f064cfc730e15ae8d3fe6bb7138644.zip |
Fix call to function sbrDecoder_Header() through pointer to incorrect function type.
While testing FDK in Android P DP3 x86 64bit emulator we observed a runtime error.
The function parameter of the callback didn't use a typeless pointer.
Following patch contains a revised sbr decoder callback function with explicit data type cast to be inline with all other callbacks in FDK.
Bug: 112662306
Bug: 116075869
Test: on x86: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: Id224de22beaf2eb9631babd838c4c3ceae0a801e
Merged-In: Idc9c44a9755b8151d5c7d8107696f43ac592413b
Diffstat (limited to 'libAACdec')
-rw-r--r-- | libAACdec/src/aacdecoder_lib.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/libAACdec/src/aacdecoder_lib.cpp b/libAACdec/src/aacdecoder_lib.cpp index d98cf5a..ea52bb5 100644 --- a/libAACdec/src/aacdecoder_lib.cpp +++ b/libAACdec/src/aacdecoder_lib.cpp @@ -368,6 +368,23 @@ static INT aacDecoder_CtrlCFGChangeCallback( return errTp; } +static INT aacDecoder_SbrCallback( + void *handle, HANDLE_FDK_BITSTREAM hBs, const INT sampleRateIn, + const INT sampleRateOut, const INT samplesPerFrame, + const AUDIO_OBJECT_TYPE coreCodec, const MP4_ELEMENT_ID elementID, + const INT elementIndex, const UCHAR harmonicSBR, + const UCHAR stereoConfigIndex, const UCHAR configMode, UCHAR *configChanged, + const INT downscaleFactor) { + HANDLE_SBRDECODER self = (HANDLE_SBRDECODER)handle; + + INT errTp = sbrDecoder_Header(self, hBs, sampleRateIn, sampleRateOut, + samplesPerFrame, coreCodec, elementID, + elementIndex, harmonicSBR, stereoConfigIndex, + configMode, configChanged, downscaleFactor); + + return errTp; +} + static INT aacDecoder_SscCallback(void *handle, HANDLE_FDK_BITSTREAM hBs, const AUDIO_OBJECT_TYPE coreCodec, const INT samplingRate, @@ -959,7 +976,7 @@ LINKSPEC_CPP HANDLE_AACDECODER aacDecoder_Open(TRANSPORT_TYPE transportFmt, goto bail; } aacDec->qmfModeUser = NOT_DEFINED; - transportDec_RegisterSbrCallback(aacDec->hInput, (cbSbr_t)sbrDecoder_Header, + transportDec_RegisterSbrCallback(aacDec->hInput, aacDecoder_SbrCallback, (void *)aacDec->hSbrDecoder); if (mpegSurroundDecoder_Open( |