summaryrefslogtreecommitdiffstats
path: root/libAACdec/src/aacdecoder_lib.cpp
diff options
context:
space:
mode:
authorliuchao <liuchao741@huawei.com>2017-02-23 21:48:07 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-02-23 21:48:07 +0000
commitef9be616803b6de920f838f1bc12f611bc7e16a2 (patch)
tree68077b14de1d24d36ef7cce1c5bdc271cbcf5342 /libAACdec/src/aacdecoder_lib.cpp
parentf4bd5f6bd44b7896d25e8a00b9f312ec2c6a54b1 (diff)
parentb0f6b2906ed8924aed7fbfdaf55bd50ead238f32 (diff)
downloadfdk-aac-ef9be616803b6de920f838f1bc12f611bc7e16a2.tar.gz
fdk-aac-ef9be616803b6de920f838f1bc12f611bc7e16a2.tar.bz2
fdk-aac-ef9be616803b6de920f838f1bc12f611bc7e16a2.zip
Merge "Fix not properly handled NULL-pointer access before check in aac lib" am: b0af861f5a
am: b0f6b2906e Change-Id: I06232a0b0126349e7d4cffff0d9c1eac90eddbb2
Diffstat (limited to 'libAACdec/src/aacdecoder_lib.cpp')
-rw-r--r--libAACdec/src/aacdecoder_lib.cpp19
1 files changed, 6 insertions, 13 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) {