[automerger skipped] c2 vp9, av1: List P010 in color formats only if it is supported am: 89d5b5a97f am: c61014b1c5 -s ours am: 71da706150 -s ours

am skip reason: Merged-In Iee516a1d45ab82308e74fe6941be748a12bab8af with SHA-1 89d5b5a97f is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/18721240

Change-Id: Ie16db132a20773e099740ff2b126824a354e40d2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/media/libstagefright/HevcUtils.cpp b/media/libstagefright/HevcUtils.cpp
index 5f9c20e..60df162 100644
--- a/media/libstagefright/HevcUtils.cpp
+++ b/media/libstagefright/HevcUtils.cpp
@@ -102,10 +102,11 @@
 static bool findParam(uint32_t key, T *param,
         KeyedVector<uint32_t, uint64_t> &params) {
     CHECK(param);
-    if (params.indexOfKey(key) < 0) {
+    ssize_t index = params.indexOfKey(key);
+    if (index < 0) {
         return false;
     }
-    *param = (T) params[key];
+    *param = (T) params[index];
     return true;
 }