Commit 44623f46 authored by David Staessens's avatar David Staessens Committed by Commit Bot

media/gpu/vaapi: Fix crash when destroying VaapiVD before initialization.

This CL fixes a crash in the VaapiVideoDecoder that occurs when the video
decoder is destroyed before it has been initialized.

TEST=ran new VD tests on eve

BUG=991064

Change-Id: I8d2f31e8ed0cdf19de7d8eb537078b09ed19c706
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1737442
Commit-Queue: David Staessens <dstaessens@chromium.org>
Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#685117}
parent 8c492d84
......@@ -243,9 +243,11 @@ void VaapiVideoDecoder::Destroy() {
DCHECK_CALLED_ON_VALID_SEQUENCE(client_sequence_checker_);
VLOGF(2);
decoder_thread_task_runner_->PostTask(
FROM_HERE, base::BindOnce(&VaapiVideoDecoder::DestroyTask, weak_this_));
decoder_thread_.Stop();
if (decoder_thread_task_runner_) {
decoder_thread_task_runner_->PostTask(
FROM_HERE, base::BindOnce(&VaapiVideoDecoder::DestroyTask, weak_this_));
decoder_thread_.Stop();
}
delete this;
VLOGF(2) << "Destroying VAAPI VD done";
......
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