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

Commit 7c9c49ee authored by Ray Essick's avatar Ray Essick
Browse files

Avoid null pointer dereference

on failed call to convertMetaDataToMessage(), return NULL instead
of assigning a null and proceeding with routine.

Bug: 229522006
Test: re-run clusterfuzz case from bug
Change-Id: I9bf705a4f543011cc35505b34dbd664f1f40f80f
parent 414127c2
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -216,7 +216,8 @@ sp<IMemory> StagefrightMetadataRetriever::getImageInternal(
    sp<AMessage> format = new AMessage;
    sp<AMessage> format = new AMessage;
    status_t err = convertMetaDataToMessage(trackMeta, &format);
    status_t err = convertMetaDataToMessage(trackMeta, &format);
    if (err != OK) {
    if (err != OK) {
        format = NULL;
        ALOGE("getImageInternal: convertMetaDataToMessage() failed, unable to extract image");
        return NULL;
    }
    }


    uint32_t bitDepth = 8;
    uint32_t bitDepth = 8;
@@ -400,7 +401,8 @@ sp<IMemory> StagefrightMetadataRetriever::getFrameInternal(
    sp<AMessage> format = new AMessage;
    sp<AMessage> format = new AMessage;
    status_t err = convertMetaDataToMessage(trackMeta, &format);
    status_t err = convertMetaDataToMessage(trackMeta, &format);
    if (err != OK) {
    if (err != OK) {
        format = NULL;
        ALOGE("getFrameInternal: convertMetaDataToMessage() failed, unable to extract frame");
        return NULL;
    }
    }


    Vector<AString> matchingCodecs;
    Vector<AString> matchingCodecs;