summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/codecs/aacdec
diff options
context:
space:
mode:
authorDave Burke <daveburke@google.com>2012-05-10 15:15:17 -0700
committerDave Burke <daveburke@google.com>2012-05-10 15:15:17 -0700
commitdc5db5d281d57ff59d92105cf0cd383df3b3c368 (patch)
treee0540b8f2b1f930dfa176db417d7abb0226a5963 /media/libstagefright/codecs/aacdec
parent2f74ef3cdc192f817ee1121f41765f0852c1d81e (diff)
downloadframeworks_av-dc5db5d281d57ff59d92105cf0cd383df3b3c368.zip
frameworks_av-dc5db5d281d57ff59d92105cf0cd383df3b3c368.tar.gz
frameworks_av-dc5db5d281d57ff59d92105cf0cd383df3b3c368.tar.bz2
Make decoder more robust to inaccurate ASCs.
Bug: 6408518 Bug: 6463794 Change-Id: Ice4ae327bc53e9d826adce572a2706e045eacd62
Diffstat (limited to 'media/libstagefright/codecs/aacdec')
-rw-r--r--media/libstagefright/codecs/aacdec/SoftAAC2.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/media/libstagefright/codecs/aacdec/SoftAAC2.cpp b/media/libstagefright/codecs/aacdec/SoftAAC2.cpp
index bf7befd..e499a0b 100644
--- a/media/libstagefright/codecs/aacdec/SoftAAC2.cpp
+++ b/media/libstagefright/codecs/aacdec/SoftAAC2.cpp
@@ -267,6 +267,15 @@ void SoftAAC2::onQueueFilled(OMX_U32 portIndex) {
inBuffer[0] = header->pBuffer + header->nOffset;
inBufferLength[0] = header->nFilledLen;
+ // Make the decoder more robust by pruning explicit backward compatible
+ // extension for LC, HE-AACv1 (SBR), HE-AACv2 (SBR + PS). We'll depend
+ // on implicit configuration.
+ if (inBufferLength[0] > 2) {
+ UCHAR aot = inBuffer[0][0] >> 3;
+ if (aot == 2 | aot == 5 | aot == 29) {
+ inBufferLength[0] = 2;
+ }
+ }
AAC_DECODER_ERROR decoderErr =
aacDecoder_ConfigRaw(mAACDecoder,
inBuffer,