diff options
author | Ian Baker <ibaker@google.com> | 2024-04-18 13:25:09 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-04-18 13:25:09 +0000 |
commit | bd98dc515dcf63b0f65f1a7fc7510208944589a7 (patch) | |
tree | 58d1501f0cf714f5ee3b6ac33792f71ab97fcf3e | |
parent | dfe71bf739eb11f23c566d4aa252ed0865e0f96e (diff) | |
parent | 5a9cbb27a7b437be4ee3093cf34260b4aed652a7 (diff) | |
download | av-bd98dc515dcf63b0f65f1a7fc7510208944589a7.tar.gz |
Merge "Handle video track with invalid WxH to avoid mediaserver crash" into main
-rw-r--r-- | media/libmediaplayerservice/nuplayer/NuPlayer.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp index bb49b5a188..bd43fe265a 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp @@ -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); } |