summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/codecs/avcdec/SoftAVCDec.cpp
diff options
context:
space:
mode:
authorHarish Mahendrakar <harish.mahendrakar@ittiam.com>2015-10-02 16:01:36 +0530
committerMarco Nelissen <marcone@google.com>2015-10-16 20:22:50 +0000
commit83835653e47c09f1d2257d4847cd95080a0673a2 (patch)
tree0cc4b1a5c3e4ccbc07c1bddb4e0bc18487c77fff /media/libstagefright/codecs/avcdec/SoftAVCDec.cpp
parentb4ec8d0558c78b94ec7bf09018a7bf653cfca525 (diff)
downloadframeworks_av-83835653e47c09f1d2257d4847cd95080a0673a2.zip
frameworks_av-83835653e47c09f1d2257d4847cd95080a0673a2.tar.gz
frameworks_av-83835653e47c09f1d2257d4847cd95080a0673a2.tar.bz2
SoftAVCDec: Exit gracefully when memory allocation fails in the decoder
Change-Id: Ib6e16be3f128e4fc97f8f05b794da980341c81cc
Diffstat (limited to 'media/libstagefright/codecs/avcdec/SoftAVCDec.cpp')
-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);