Commit 58013d32 authored by liberato@chromium.org's avatar liberato@chromium.org Committed by Commit Bot

Add null check to MediaCodecVideoDecoder::OnSurfaceDestroyed

OnSurfaceDestroyed was unconditionally dereferencing
|target_surface_bundle_|, but this can be cleared once the codec
enters a terminal state.  A null target bundle should just be
ignored anyway.

Bug: 806630
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I612c8a0c95ec0e3b918789384f44ad3a01fd2559
Reviewed-on: https://chromium-review.googlesource.com/893638Reviewed-by: default avatarThomas Guilbert <tguilbert@chromium.org>
Commit-Queue: Frank Liberato <liberato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532974}
parent 650a5e42
......@@ -357,8 +357,10 @@ void MediaCodecVideoDecoder::OnSurfaceDestroyed(AndroidOverlay* overlay) {
}
// Reset the target bundle if it is the one being destroyed.
if (target_surface_bundle_->overlay.get() == overlay)
if (target_surface_bundle_ &&
target_surface_bundle_->overlay.get() == overlay) {
target_surface_bundle_ = surface_texture_bundle_;
}
// Transition the codec away from the overlay if necessary.
if (SurfaceTransitionPending())
......
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