summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/codecs
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2015-10-16 21:27:10 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-10-16 21:27:10 +0000
commitd538baad390c1fe5abb13fe821b4ac3d0006d431 (patch)
tree070319304584e851bf7b1582b77f5f6aaa9626d6 /media/libstagefright/codecs
parente5d82cbafcd7bf13bcd23ca6a0066d7444c6332b (diff)
parent83835653e47c09f1d2257d4847cd95080a0673a2 (diff)
downloadframeworks_av-d538baad390c1fe5abb13fe821b4ac3d0006d431.zip
frameworks_av-d538baad390c1fe5abb13fe821b4ac3d0006d431.tar.gz
frameworks_av-d538baad390c1fe5abb13fe821b4ac3d0006d431.tar.bz2
Merge "SoftAVCDec: Exit gracefully when memory allocation fails in the decoder" into mnc-dr-dev
Diffstat (limited to 'media/libstagefright/codecs')
-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);