diff options
author | Andreas Huber <andih@google.com> | 2011-05-04 13:09:35 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2011-05-04 13:09:35 -0700 |
commit | 59633a1e0ae968a90367718fb21716c32d73af04 (patch) | |
tree | 6d90ffc1b55cfc5e37074b27c144a05f64173005 /media/libstagefright/codecs/aacdec/AACDecoder.cpp | |
parent | 87ae62f327eb155a595ab6400e924667fd50a852 (diff) | |
download | frameworks_av-59633a1e0ae968a90367718fb21716c32d73af04.zip frameworks_av-59633a1e0ae968a90367718fb21716c32d73af04.tar.gz frameworks_av-59633a1e0ae968a90367718fb21716c32d73af04.tar.bz2 |
Signal an error if aac decoding fails early.
Change-Id: I8b886a7642aaf83fa008fefb38cb4f92267ca948
related-to-bug: 4272179
Diffstat (limited to 'media/libstagefright/codecs/aacdec/AACDecoder.cpp')
-rw-r--r-- | media/libstagefright/codecs/aacdec/AACDecoder.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/media/libstagefright/codecs/aacdec/AACDecoder.cpp b/media/libstagefright/codecs/aacdec/AACDecoder.cpp index 208431c..d2e3eaa 100644 --- a/media/libstagefright/codecs/aacdec/AACDecoder.cpp +++ b/media/libstagefright/codecs/aacdec/AACDecoder.cpp @@ -234,6 +234,23 @@ status_t AACDecoder::read( mConfig->aacPlusUpsamplingFactor, mConfig->desiredChannels); CHECK(mNumDecodedBuffers > 0); + + if (decoderErr != MP4AUDEC_SUCCESS) { + // If decoding fails this early, the fields in mConfig may + // not be valid and we cannot recover. + + LOGE("Unable to decode aac content, decoder returned error %d", + decoderErr); + + buffer->release(); + buffer = NULL; + + mInputBuffer->release(); + mInputBuffer = NULL; + + return ERROR_UNSUPPORTED; + } + if (mNumDecodedBuffers == 1) { mUpsamplingFactor = mConfig->aacPlusUpsamplingFactor; // Check on the sampling rate to see whether it is changed. |