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

Unified Diff: ppapi/proxy/ppb_image_data_proxy.cc

Issue 383143003: Pepper: Make sure 'out' params are initialized for all code paths. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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/ppb_instance_proxy.cc » ('j') | ppapi/proxy/ppb_instance_proxy.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_image_data_proxy.cc
diff --git a/ppapi/proxy/ppb_image_data_proxy.cc b/ppapi/proxy/ppb_image_data_proxy.cc
index 51751668f228dd9fef77218feabfcf55010eef47..e509076a90903def9de6f08c349eb37f6f2b0a40 100644
--- a/ppapi/proxy/ppb_image_data_proxy.cc
+++ b/ppapi/proxy/ppb_image_data_proxy.cc
@@ -494,9 +494,7 @@ PP_Resource PPB_ImageData_Proxy::CreateProxyResource(
}
HostResource result;
- // Initialize desc so we don't send unitialized memory over IPC.
- // https://crbug.com/391023.
- PP_ImageDataDesc desc = {};
+ PP_ImageDataDesc desc;
switch (type) {
case PPB_ImageData_Shared::SIMPLE: {
ppapi::proxy::SerializedHandle image_handle_wrapper;
@@ -622,6 +620,9 @@ void PPB_ImageData_Proxy::OnHostMsgCreatePlatform(
HostResource* result,
PP_ImageDataDesc* desc,
ImageHandle* result_image_handle) {
+ // Clear |desc| so we don't send unitialized memory to the plugin.
+ // https://crbug.com/391023.
+ memset(desc, 0, sizeof(*desc));
dmichael (off chromium) 2014/07/11 15:22:25 *desc = PP_ImageDataDesc(); ?
bbudge 2014/07/11 15:23:40 David, the reason I've gone back to memset is to e
dmichael (off chromium) 2014/07/11 15:51:52 Okay, that makes sense. still lgtm
bbudge 2014/07/11 17:01:55 Sorry for churn, switching back to *desc = PP_Imag
IPC::PlatformFileForTransit image_handle;
uint32_t byte_count;
PP_Resource resource =
@@ -647,6 +648,9 @@ void PPB_ImageData_Proxy::OnHostMsgCreateSimple(
HostResource* result,
PP_ImageDataDesc* desc,
ppapi::proxy::SerializedHandle* result_image_handle) {
+ // Clear |desc| so we don't send unitialized memory to the plugin.
+ // https://crbug.com/391023.
+ memset(desc, 0, sizeof(*desc));
IPC::PlatformFileForTransit image_handle;
uint32_t byte_count;
PP_Resource resource =
« no previous file with comments | « no previous file | ppapi/proxy/ppb_instance_proxy.cc » ('j') | ppapi/proxy/ppb_instance_proxy.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698