Commit f00e0da1 authored by Andres Calderon Jaramillo's avatar Andres Calderon Jaramillo Committed by Commit Bot

V4L2SVDA: Validate visible rectangle.

This CL adds a check in
V4L2SliceVideoDecodeAccelerator::CreateOutputBuffers() to ensure that
the visible rectangle is contained within the coded size. Note that
there are analogous checks in VAAPI [1] and V4L2VDA [2].

[1] https://source.chromium.org/chromium/chromium/src/+/master:media/gpu/vaapi/vaapi_video_decode_accelerator.cc;l=455-458;drc=43a49df1600f4828a16317757aab3b2eb1478287?originalUrl=https:%2F%2Fcs.chromium.org%2F
[2] https://source.chromium.org/chromium/chromium/src/+/master:media/gpu/v4l2/v4l2_video_decode_accelerator.cc;l=2262-2266;drc=008125344bd4814259607c541da5e6a792dc06ff?originalUrl=https:%2F%2Fcs.chromium.org%2F

Bug: 1062002
Test: normal playback still works on kevin and krane.
Change-Id: I5dd13e92822b20bb6dadbbea6b48a4bc06ed7a20
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2131416
Auto-Submit: Andres Calderon Jaramillo <andrescj@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: default avatarAlexandre Courbot <acourbot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755271}
parent 6234e2d9
...@@ -681,6 +681,12 @@ bool V4L2SliceVideoDecodeAccelerator::CreateOutputBuffers() { ...@@ -681,6 +681,12 @@ bool V4L2SliceVideoDecodeAccelerator::CreateOutputBuffers() {
DCHECK_EQ(coded_size_.width() % 16, 0); DCHECK_EQ(coded_size_.width() % 16, 0);
DCHECK_EQ(coded_size_.height() % 16, 0); DCHECK_EQ(coded_size_.height() % 16, 0);
if (!gfx::Rect(coded_size_).Contains(decoder_->GetVisibleRect())) {
VLOGF(1) << "The visible rectangle is not contained in the coded size";
NOTIFY_ERROR(UNREADABLE_INPUT);
return false;
}
// Now that we know the desired buffers resolution, ask the image processor // Now that we know the desired buffers resolution, ask the image processor
// what it supports so we can request the correct picture buffers. // what it supports so we can request the correct picture buffers.
if (image_processor_device_) { if (image_processor_device_) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment