Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f39635b4 authored by Pawin Vongmasa's avatar Pawin Vongmasa Committed by android-build-merger
Browse files

Prevent crash from unknown mime type

am: fbe5bd5d

Change-Id: Ie09a0cbd6de0cf92a6a72a0fe6ef05eb6426d830
parents 985f2f6c fbe5bd5d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -986,6 +986,12 @@ void MediaCodecsXmlParser::generateRoleMap() const {
        for (const auto& type : typeMap) {
            const auto& typeName = type.first;
            const char* roleName = GetComponentRole(isEncoder, typeName.data());
            if (roleName == nullptr) {
                ALOGE("Cannot find the role for %s of type %s",
                        isEncoder ? "an encoder" : "a decoder",
                        typeName.data());
                continue;
            }
            const auto& typeAttributeMap = type.second;

            auto roleIterator = mRoleMap.find(roleName);