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

Unified Diff: gpu/command_buffer/service/common_decoder.cc

Issue 5305005: Initialize destinations variables before calling GL functions... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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 | « gpu/command_buffer/service/common_decoder.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/common_decoder.cc
===================================================================
--- gpu/command_buffer/service/common_decoder.cc (revision 67161)
+++ gpu/command_buffer/service/common_decoder.cc (working copy)
@@ -35,11 +35,16 @@
return false;
}
-void CommonDecoder::Bucket::SetFromString(const std::string& str) {
+void CommonDecoder::Bucket::SetFromString(const char* str) {
// Strings are passed NULL terminated to distinguish between empty string
// and no string.
- SetSize(str.size() + 1);
- SetData(str.c_str(), 0, str.size() + 1);
+ if (!str) {
+ SetSize(0);
+ } else {
+ size_t size = strlen(str) + 1;
+ SetSize(size);
+ SetData(str, 0, size);
+ }
}
bool CommonDecoder::Bucket::GetAsString(std::string* str) {
« no previous file with comments | « gpu/command_buffer/service/common_decoder.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698