Commit 398f6059 authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Commit Bot

media/gpu/v4l2svda: fix crash when using --disable_rendering

CL 6ddfe0d8 (media/gpu/v4l2svda: use queue of GL fences) added a queue
of buffers waiting for a fence, but added a NULL fence if rendering was
disabled. This NULL fence was then dereferenced by CheckGLFences(),
causing a crash.

Fix this by only adding the fence if it actually exists.

Bug: b:132589320
Test: vdaunittest passing on Kevin and Kukui with and without
--disable_rendering.

Change-Id: Ib63dd04be4aca8a65f8906875b0b12d50032225f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1750469
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686319}
parent b63d9a1c
......@@ -1576,8 +1576,9 @@ void V4L2SliceVideoDecodeAccelerator::ReusePictureBufferTask(
// When the last fence is signaled, all the previous fences must be executed.
if (!output_record.at_client()) {
// Take ownership of the EGL fence.
surfaces_awaiting_fence_.push(
std::make_pair(std::move(egl_fence), std::move(it->second)));
if (egl_fence)
surfaces_awaiting_fence_.push(
std::make_pair(std::move(egl_fence), std::move(it->second)));
surfaces_at_display_.erase(it);
}
......
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