Commit e5b88bd5 authored by Ricky Liang's avatar Ricky Liang Committed by Commit Bot

media: avoid crash when VCD client fails to get I420 output buffer

We should discard the incoming capture GpuMemoryBuffer and return when
VideoCaptureDeviceClient::OnIncomingCapturedGfxBuffer fails to reserve
the I420 output buffer. Otherwise we'll end up crashing.

BUG=b:79729317
R=emircan

Change-Id: I616d97ca618ad9cc40abdf9d1a8f06ce568cfbb0
Reviewed-on: https://chromium-review.googlesource.com/1059495Reviewed-by: default avatarEmircan Uysaler <emircan@chromium.org>
Commit-Queue: Ricky Liang <jcliang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558721}
parent dc73f6f1
......@@ -333,6 +333,10 @@ void VideoCaptureDeviceClient::OnIncomingCapturedGfxBuffer(
auto output_buffer =
ReserveOutputBuffer(dimensions, PIXEL_FORMAT_I420, frame_feedback_id);
// Failed to reserve I420 output buffer, so drop the frame.
if (!output_buffer.is_valid())
return;
uint8_t* y_plane_data;
uint8_t* u_plane_data;
uint8_t* v_plane_data;
......
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