Fix ndk findId
|findId| should search by |id| value, rather than
original memory address
bug:35227555
Change-Id: I53257d0fa833f61258a26b7e905879eeceab6b26
diff --git a/media/ndk/NdkMediaDrm.cpp b/media/ndk/NdkMediaDrm.cpp
index fe08ab9..6d10f1c 100644
--- a/media/ndk/NdkMediaDrm.cpp
+++ b/media/ndk/NdkMediaDrm.cpp
@@ -224,7 +224,7 @@
static bool findId(AMediaDrm *mObj, const AMediaDrmByteArray &id, List<idvec_t>::iterator &iter) {
for (iter = mObj->mIds.begin(); iter != mObj->mIds.end(); ++iter) {
- if (iter->array() == id.ptr && iter->size() == id.length) {
+ if (id.length == iter->size() && memcmp(iter->array(), id.ptr, iter->size()) == 0) {
return true;
}
}