diff options
author | Mingming Yin <mingming@codeaurora.org> | 2014-09-04 16:22:19 -0700 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:24:23 -0600 |
commit | 9c7d957b70a4daa29af48cb4c695bae64eb5bcf1 (patch) | |
tree | 9faca0c9380adcd6191676dc1570cee37899f509 /media | |
parent | 6a399a153e98d86a58cd09c4e2ac9ce3e7a7dfbc (diff) | |
download | frameworks_av-9c7d957b70a4daa29af48cb4c695bae64eb5bcf1.zip frameworks_av-9c7d957b70a4daa29af48cb4c695bae64eb5bcf1.tar.gz frameworks_av-9c7d957b70a4daa29af48cb4c695bae64eb5bcf1.tar.bz2 |
stagefright: Remove assert for corrupt clips for AMRNB
Corrupt AMR NB clips were crashing media player
This was due to the assert in the AMRNB decoder.
To avoid this, post error and exit if corrupt
clip is played.
CRs-Fixed: 486681
Change-Id: I4c27a95978015e5493799ca23a3598559ad8bd9d
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/codecs/amrnb/dec/SoftAMR.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/media/libstagefright/codecs/amrnb/dec/SoftAMR.cpp b/media/libstagefright/codecs/amrnb/dec/SoftAMR.cpp index a9723ea..f8316fd 100644 --- a/media/libstagefright/codecs/amrnb/dec/SoftAMR.cpp +++ b/media/libstagefright/codecs/amrnb/dec/SoftAMR.cpp @@ -352,7 +352,14 @@ void SoftAMR::onQueueFilled(OMX_U32 /* portIndex */) { } size_t frameSize = getFrameSize(mode); - CHECK_GE(inHeader->nFilledLen, frameSize); + if (inHeader->nFilledLen < frameSize) { + ALOGE("Filled length vs frameSize %u vs %lu. Corrupt clip?", + inHeader->nFilledLen, frameSize); + + notify(OMX_EventError, OMX_ErrorUndefined, 0, NULL); + mSignalledError = true; + return; + } int16_t *outPtr = (int16_t *)outHeader->pBuffer; |