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

Commit 272c895e authored by Chong Zhang's avatar Chong Zhang
Browse files

Fix string use-after-free in mediaswcodec

Bug:118190129
Change-Id: I7228e8eeb7d5e616d0ce19d9603667dc7b1a9ba7
parent f45f32cc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -71,10 +71,10 @@ binder::Status MediaCodecUpdateService::loadPlugins(const ::std::string& apkPath
        String8 libPathInApk = String8("lib/") + String8(abis[0].c_str());
        String8 defaultLibPath = String8(apkPath.c_str()) + "!/" + libPathInApk;
        String8 libPath = defaultLibPath + "/libmedia_codecserviceregistrant.so";
        String8 zipEntryPath = libPathInApk + "/libmedia_codecserviceregistrant.so";

        ZipEntry entry;
        ZipString name(libPathInApk + "/libmedia_codecserviceregistrant.so");
        ret = FindEntry(zipHandle, name, &entry);
        ret = FindEntry(zipHandle, ZipString(zipEntryPath), &entry);

        if (ret == 0) {
            android_namespace_t *codecNs = android_create_namespace("codecs",