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

Commit bd98dc51 authored by Ian Baker's avatar Ian Baker Committed by Gerrit Code Review
Browse files

Merge "Handle video track with invalid WxH to avoid mediaserver crash" into main

parents dfe71bf7 5a9cbb27
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -2098,9 +2098,12 @@ void NuPlayer::updateVideoSize(
             displayHeight,
             cropLeft, cropTop);
    } else {
        CHECK(inputFormat->findInt32("width", &displayWidth));
        CHECK(inputFormat->findInt32("height", &displayHeight));

        if (!inputFormat->findInt32("width", &displayWidth)
            || !inputFormat->findInt32("height", &displayHeight)) {
            ALOGW("Either video width or video height missing, reporting 0x0!");
            notifyListener(MEDIA_SET_VIDEO_SIZE, 0, 0);
            return;
        }
        ALOGV("Video input format %d x %d", displayWidth, displayHeight);
    }