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

Unified Diff: ppapi/proxy/video_encoder_resource.cc

Issue 1138483002: ppapi: fix crash/infinite loop in VideoEncoder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment Created 5 years, 7 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 | ppapi/proxy/video_encoder_resource_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/video_encoder_resource.cc
diff --git a/ppapi/proxy/video_encoder_resource.cc b/ppapi/proxy/video_encoder_resource.cc
index a4e5a66ccb29638aba3a09a525597848eadfd59d..01c6b0e1612fccb43510f552847830c96519851d 100644
--- a/ppapi/proxy/video_encoder_resource.cc
+++ b/ppapi/proxy/video_encoder_resource.cc
@@ -361,7 +361,12 @@ void VideoEncoderResource::OnPluginMsgEncodeReply(
PP_Resource video_frame,
const ResourceMessageReplyParams& params,
uint32_t frame_id) {
- DCHECK_NE(encode_callbacks_.size(), 0U);
+ // We need to ensure there are still callbacks to be called before
+ // processing this message. We might receive a EncodeReply message
+ // after having sent a Close message to the renderer. In this case,
+ // we don't have any callback left to call.
+ if (encode_callbacks_.empty())
+ return;
encoder_last_error_ = params.result();
EncodeMap::iterator it = encode_callbacks_.find(video_frame);
« no previous file with comments | « no previous file | ppapi/proxy/video_encoder_resource_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698