diff options
author | liuchao <liuchao741@huawei.com> | 2017-02-23 21:50:11 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-02-23 21:50:11 +0000 |
commit | 47dd0b45892a39c9a8b3822745dddb255c3886c4 (patch) | |
tree | e1e8bc174eb8e3e29646a8d4b5c5ed696d0acb1f | |
parent | 30fa0b87e9b0306cdd59e6c5d3e8ff5cab56d026 (diff) | |
parent | ef9be616803b6de920f838f1bc12f611bc7e16a2 (diff) | |
download | fdk-aac-47dd0b45892a39c9a8b3822745dddb255c3886c4.tar.gz fdk-aac-47dd0b45892a39c9a8b3822745dddb255c3886c4.tar.bz2 fdk-aac-47dd0b45892a39c9a8b3822745dddb255c3886c4.zip |
Merge "Fix not properly handled NULL-pointer access before check in aac lib" am: b0af861f5a am: b0f6b2906e
am: ef9be61680
Change-Id: Ibfe81134a2089946800580538775faaa1bbe00ef
-rw-r--r-- | libAACdec/src/aacdecoder_lib.cpp | 19 | ||||
-rw-r--r-- | libAACenc/src/metadata_main.cpp | 10 |
2 files changed, 10 insertions, 19 deletions
diff --git a/libAACdec/src/aacdecoder_lib.cpp b/libAACdec/src/aacdecoder_lib.cpp index 8863da5..50efb0f 100644 --- a/libAACdec/src/aacdecoder_lib.cpp +++ b/libAACdec/src/aacdecoder_lib.cpp @@ -791,36 +791,29 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_DecodeFrame( const UINT flags) { AAC_DECODER_ERROR ErrorStatus; - INT layer; - INT nBits; - INT interleaved = self->outputInterleaved; - HANDLE_FDK_BITSTREAM hBs; int fTpInterruption = 0; /* Transport originated interruption detection. */ int fTpConceal = 0; /* Transport originated concealment. */ - INT_PCM *pTimeData = NULL; - INT timeDataSize = 0; - if (self == NULL) { return AAC_DEC_INVALID_HANDLE; } - - pTimeData = self->pcmOutputBuffer; - timeDataSize = sizeof(self->pcmOutputBuffer)/sizeof(*self->pcmOutputBuffer); + INT interleaved = self->outputInterleaved; + INT_PCM *pTimeData = self->pcmOutputBuffer; + INT timeDataSize = sizeof(self->pcmOutputBuffer)/sizeof(*self->pcmOutputBuffer); if (flags & AACDEC_INTR) { self->streamInfo.numLostAccessUnits = 0; } - hBs = transportDec_GetBitstream(self->hInput, 0); + HANDLE_FDK_BITSTREAM hBs = transportDec_GetBitstream(self->hInput, 0); /* Get current bits position for bitrate calculation. */ - nBits = FDKgetValidBits(hBs); + INT nBits = FDKgetValidBits(hBs); if (! (flags & (AACDEC_CONCEAL | AACDEC_FLUSH) ) ) { TRANSPORTDEC_ERROR err; - for(layer = 0; layer < self->nrOfLayers; layer++) + for(INT layer = 0; layer < self->nrOfLayers; layer++) { err = transportDec_ReadAccessUnit(self->hInput, layer); if (err != TRANSPORTDEC_OK) { diff --git a/libAACenc/src/metadata_main.cpp b/libAACenc/src/metadata_main.cpp index e920793..90f8f4e 100644 --- a/libAACenc/src/metadata_main.cpp +++ b/libAACenc/src/metadata_main.cpp @@ -488,14 +488,12 @@ static FDK_METADATA_ERROR ProcessCompressor( { FDK_METADATA_ERROR err = METADATA_OK; - INT dynrng, compr; - DRC_PROFILE profileDrc = convertProfile(pMetadata->mpegDrc.drc_profile); - DRC_PROFILE profileComp = convertProfile(pMetadata->etsiAncData.comp_profile); - if ( (pMetadata==NULL) || (hDrcComp==NULL) ) { err = METADATA_INVALID_HANDLE; return err; } + DRC_PROFILE profileDrc = convertProfile(pMetadata->mpegDrc.drc_profile); + DRC_PROFILE profileComp = convertProfile(pMetadata->etsiAncData.comp_profile); /* first, check if profile is same as last frame * otherwise, update setup */ @@ -511,8 +509,8 @@ static FDK_METADATA_ERROR ProcessCompressor( } /* in case of embedding external values, copy this now (limiter may overwrite them) */ - dynrng = decodeDynrng(pMetadata->mpegDrc.dyn_rng_ctl[0], pMetadata->mpegDrc.dyn_rng_sgn[0]); - compr = decodeCompr(pMetadata->etsiAncData.compression_value); + INT dynrng = decodeDynrng(pMetadata->mpegDrc.dyn_rng_ctl[0], pMetadata->mpegDrc.dyn_rng_sgn[0]); + INT compr = decodeCompr(pMetadata->etsiAncData.compression_value); /* Call compressor */ if (FDK_DRC_Generator_Calc(hDrcComp, |