Index: ppapi/proxy/ppp_content_decryptor_private_proxy.cc |
diff --git a/ppapi/proxy/ppp_content_decryptor_private_proxy.cc b/ppapi/proxy/ppp_content_decryptor_private_proxy.cc |
index 29190afcd9ffe4292fa9bc447d7f9ec9168e6675..e04e4cbca2c5c6b4e69928e5c462bb5569435998 100644 |
--- a/ppapi/proxy/ppp_content_decryptor_private_proxy.cc |
+++ b/ppapi/proxy/ppp_content_decryptor_private_proxy.cc |
@@ -485,10 +485,14 @@ void PPP_ContentDecryptor_Private_Proxy::OnMsgDecryptAndDecode( |
const PPPDecryptor_Buffer& encrypted_buffer, |
const std::string& serialized_block_info) { |
if (ppp_decryptor_impl_) { |
- PP_Resource plugin_resource = |
- PPB_Buffer_Proxy::AddProxyResource(encrypted_buffer.resource, |
- encrypted_buffer.handle, |
- encrypted_buffer.size); |
+ PP_Resource plugin_resource = 0; |
xhwang
2012/10/19 07:12:40
Since PP_Resource of 0 can happen if error happens
Tom Finegan
2012/10/20 00:57:17
Discussion in progress offline, but I don't think
|
+ if (encrypted_buffer.size > 0) { |
+ plugin_resource = |
+ PPB_Buffer_Proxy::AddProxyResource(encrypted_buffer.resource, |
brettw
2012/10/19 23:03:54
If you don't hit this line I believe encrypted_buf
Tom Finegan
2012/10/20 00:57:17
Changed this and the usage above to occur only whe
|
+ encrypted_buffer.handle, |
+ encrypted_buffer.size); |
+ } |
+ |
PP_EncryptedBlockInfo block_info; |
if (!DeserializeBlockInfo(serialized_block_info, &block_info)) |
return; |
brettw
2012/10/19 23:03:54
If you hit this the plugin_resource will leak
Tom Finegan
2012/10/20 00:57:17
Done. Thanks! This part now happens before we do a
|