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

Side by Side Diff: chrome/renderer/webplugin_delegate_pepper.cc

Issue 2802035: Coverity: Fix null dereference in WebPluginDelegatePepper::Device3DInitializeContext error case. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Created 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #define PEPPER_APIS_ENABLED 1 5 #define PEPPER_APIS_ENABLED 1
6 6
7 #include "chrome/renderer/webplugin_delegate_pepper.h" 7 #include "chrome/renderer/webplugin_delegate_pepper.h"
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 SendNestedDelegateGeometryToBrowser(window_rect_, clip_rect_); 712 SendNestedDelegateGeometryToBrowser(window_rect_, clip_rect_);
713 713
714 // Save the implementation information (the CommandBuffer). 714 // Save the implementation information (the CommandBuffer).
715 Device3DImpl* impl = new Device3DImpl; 715 Device3DImpl* impl = new Device3DImpl;
716 impl->command_buffer = command_buffer_; 716 impl->command_buffer = command_buffer_;
717 impl->dynamically_created = false; 717 impl->dynamically_created = false;
718 context->reserved = impl; 718 context->reserved = impl;
719 719
720 return NPERR_NO_ERROR; 720 return NPERR_NO_ERROR;
721 } 721 }
722
723 nested_delegate_->DestroyCommandBuffer(command_buffer_);
724 command_buffer_ = NULL;
722 } 725 }
723
724 nested_delegate_->DestroyCommandBuffer(command_buffer_);
725 command_buffer_ = NULL;
726 } 726 }
727 727
728 nested_delegate_->PluginDestroyed(); 728 nested_delegate_->PluginDestroyed();
729 nested_delegate_ = NULL; 729 nested_delegate_ = NULL;
730 #endif // ENABLE_GPU 730 #endif // ENABLE_GPU
731 731
732 return NPERR_GENERIC_ERROR; 732 return NPERR_GENERIC_ERROR;
733 } 733 }
734 734
735 NPError WebPluginDelegatePepper::Device3DSetStateContext( 735 NPError WebPluginDelegatePepper::Device3DSetStateContext(
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after
1749 bounds.origin.x = dest_rect.x(); 1749 bounds.origin.x = dest_rect.x();
1750 bounds.origin.y = canvas_height - dest_rect.y() - dest_rect.height(); 1750 bounds.origin.y = canvas_height - dest_rect.y() - dest_rect.height();
1751 bounds.size.width = dest_rect.width(); 1751 bounds.size.width = dest_rect.width();
1752 bounds.size.height = dest_rect.height(); 1752 bounds.size.height = dest_rect.height();
1753 1753
1754 CGContextDrawImage(canvas, bounds, image); 1754 CGContextDrawImage(canvas, bounds, image);
1755 CGContextRestoreGState(canvas); 1755 CGContextRestoreGState(canvas);
1756 } 1756 }
1757 #endif // defined(OS_MACOSX) 1757 #endif // defined(OS_MACOSX)
1758 1758
OLDNEW
« 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