Commit 25125321 authored by Dale Curtis's avatar Dale Curtis Committed by Commit Bot

[WebCodecs] Fix null callback crash on Android.

An invalid RequestOverlayInfoCB was provided which triggered a nullptr
crash when the callback was later executed.

R=liberato

Bug: 1135073
Change-Id: I62e4da8b5aec7ae32b8fb82ee6eea38346cd833b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2469446
Auto-Submit: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Frank Liberato <liberato@chromium.org>
Reviewed-by: default avatarFrank Liberato <liberato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#817042}
parent 66a5c482
......@@ -190,18 +190,26 @@ class MediaVideoTaskWrapper {
std::move(external_decoder_factory));
}
std::vector<std::unique_ptr<media::VideoDecoder>> OnCreateDecoders() {
void OnRequestOverlayInfo(bool decoder_requires_restart_for_overlay,
media::ProvideOverlayInfoCB overlay_info_cb) {
DVLOG(2) << __func__;
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// TODO(chcunningham): Add plumbing to enable overlays on Android. See
// handling in WebMediaPlayerImpl.
media::RequestOverlayInfoCB request_overlay_info_cb;
// Android overlays are not supported.
if (overlay_info_cb)
std::move(overlay_info_cb).Run(media::OverlayInfo());
}
std::vector<std::unique_ptr<media::VideoDecoder>> OnCreateDecoders() {
DVLOG(2) << __func__;
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
std::vector<std::unique_ptr<media::VideoDecoder>> video_decoders;
decoder_factory_->CreateVideoDecoders(
media_task_runner_, gpu_factories_, &null_media_log_,
request_overlay_info_cb, target_color_space_, &video_decoders);
WTF::BindRepeating(&MediaVideoTaskWrapper::OnRequestOverlayInfo,
weak_factory_.GetWeakPtr()),
target_color_space_, &video_decoders);
return video_decoders;
}
......
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