Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1036)

Unified Diff: media/filters/gpu_video_decoder.cc

Issue 2109343002: Fix a potential segfault in GpuVideoDecoder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/gpu_video_decoder.cc
diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc
index 5f65eb2ac90664001b590eca9c3472967df98cc3..f52ef5d330a07f56cb80378018de2eeb7a86fca9 100644
--- a/media/filters/gpu_video_decoder.cc
+++ b/media/filters/gpu_video_decoder.cc
@@ -287,6 +287,12 @@ void GpuVideoDecoder::CompleteInitialization(int cdm_id, int surface_id) {
DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent();
DCHECK(!init_cb_.is_null());
+ // It's possible for the vda to become null if NotifyError is called.
+ if (!vda_) {
+ base::ResetAndReturn(&init_cb_).Run(false);
+ return;
+ }
+
VideoDecodeAccelerator::Config vda_config;
vda_config.profile = config_.profile();
vda_config.cdm_id = cdm_id;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698