summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarish Mahendrakar <harish.mahendrakar@ittiam.com>2015-10-02 16:01:36 +0530
committerSteve Kondik <steve@cyngn.com>2015-11-07 12:07:36 -0800
commit839764494b74daa6630ee07ef4868983d4296eb7 (patch)
treece25d6a933bb312799e90440e0d2661cc7c3e35f
parent1684b7ca345c22f7297952b9340e884c3f2dc2c6 (diff)
downloadframeworks_av-839764494b74daa6630ee07ef4868983d4296eb7.zip
frameworks_av-839764494b74daa6630ee07ef4868983d4296eb7.tar.gz
frameworks_av-839764494b74daa6630ee07ef4868983d4296eb7.tar.bz2
SoftAVCDec: Exit gracefully when memory allocation fails in the decoder
Change-Id: Ib6e16be3f128e4fc97f8f05b794da980341c81cc
-rw-r--r--media/libstagefright/codecs/avcdec/SoftAVCDec.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/media/libstagefright/codecs/avcdec/SoftAVCDec.cpp b/media/libstagefright/codecs/avcdec/SoftAVCDec.cpp
index 8101f75..afbe230 100644
--- a/media/libstagefright/codecs/avcdec/SoftAVCDec.cpp
+++ b/media/libstagefright/codecs/avcdec/SoftAVCDec.cpp
@@ -477,6 +477,9 @@ void SoftAVC::onQueueFilled(OMX_U32 portIndex) {
if (NULL == mCodecCtx) {
if (OK != initDecoder()) {
+ ALOGE("Failed to initialize decoder");
+ notify(OMX_EventError, OMX_ErrorUnsupportedSetting, 0, NULL);
+ mSignalledError = true;
return;
}
}
@@ -593,6 +596,14 @@ void SoftAVC::onQueueFilled(OMX_U32 portIndex) {
return;
}
+ bool allocationFailed = (IVD_MEM_ALLOC_FAILED == (s_dec_op.u4_error_code & 0xFF));
+ if (allocationFailed) {
+ ALOGE("Allocation failure in decoder");
+ notify(OMX_EventError, OMX_ErrorUnsupportedSetting, 0, NULL);
+ mSignalledError = true;
+ return;
+ }
+
bool resChanged = (IVD_RES_CHANGED == (s_dec_op.u4_error_code & 0xFF));
GETTIME(&mTimeEnd, NULL);