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

Commit f2a402c3 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "FrameDecoder:Return error if dimension is missing" into sc-qpr1-dev am: 8437fc5d

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

Change-Id: I17af867da99e32132c1da91ba5a76d9d1cb2dc23
parents 6e6c9b08 8437fc5d
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -883,9 +883,18 @@ status_t MediaImageDecoder::onOutputReceived(
    }

    int32_t width, height, stride;
    CHECK(outputFormat->findInt32("width", &width));
    CHECK(outputFormat->findInt32("height", &height));
    CHECK(outputFormat->findInt32("stride", &stride));
    if (outputFormat->findInt32("width", &width) == false) {
        ALOGE("MediaImageDecoder::onOutputReceived:width is missing in outputFormat");
        return ERROR_MALFORMED;
    }
    if (outputFormat->findInt32("height", &height) == false) {
        ALOGE("MediaImageDecoder::onOutputReceived:height is missing in outputFormat");
        return ERROR_MALFORMED;
    }
    if (outputFormat->findInt32("stride", &stride) == false) {
        ALOGE("MediaImageDecoder::onOutputReceived:stride is missing in outputFormat");
        return ERROR_MALFORMED;
    }

    if (mFrame == NULL) {
        sp<IMemory> frameMem = allocVideoFrame(