am 6635c44c: Merge "Fix assertion triggered when mediaserver dies at roughly the same" into jb-dev
* commit '6635c44c27a8fc2f1eeaaefd5dfc2e65464bcb5d':
Fix assertion triggered when mediaserver dies at roughly the same
diff --git a/media/libstagefright/omx/OMX.cpp b/media/libstagefright/omx/OMX.cpp
index f11fcd2..681e321 100644
--- a/media/libstagefright/omx/OMX.cpp
+++ b/media/libstagefright/omx/OMX.cpp
@@ -253,7 +253,11 @@
OMXNodeInstance *instance = findInstance(node);
ssize_t index = mLiveNodes.indexOfKey(instance->observer()->asBinder());
- CHECK(index >= 0);
+ if (index < 0) {
+ // This could conceivably happen if the observer dies at roughly the
+ // same time that a client attempts to free the node explicitly.
+ return OK;
+ }
mLiveNodes.removeItemsAt(index);
instance->observer()->asBinder()->unlinkToDeath(this);