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

Side by Side Diff: gpu/ipc/gpu_command_buffer_traits.cc

Issue 1383463005: Fix array out of bounds access in loop iteration in gpu ipc log (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reworked as per comments! Created 5 years, 2 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "gpu/ipc/gpu_command_buffer_traits.h" 5 #include "gpu/ipc/gpu_command_buffer_traits.h"
6 6
7 #include "gpu/command_buffer/common/mailbox_holder.h" 7 #include "gpu/command_buffer/common/mailbox_holder.h"
8 #include "gpu/command_buffer/common/value_state.h" 8 #include "gpu/command_buffer/common/value_state.h"
9 9
10 // Generate param traits write methods. 10 // Generate param traits write methods.
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 const char* data = NULL; 108 const char* data = NULL;
109 if (!iter->ReadData(&data, &length) || length != sizeof(gpu::ValueState)) 109 if (!iter->ReadData(&data, &length) || length != sizeof(gpu::ValueState))
110 return false; 110 return false;
111 DCHECK(data); 111 DCHECK(data);
112 memcpy(p, data, sizeof(gpu::ValueState)); 112 memcpy(p, data, sizeof(gpu::ValueState));
113 return true; 113 return true;
114 } 114 }
115 115
116 void ParamTraits<gpu::ValueState>::Log(const param_type& p, std::string* l) { 116 void ParamTraits<gpu::ValueState>::Log(const param_type& p, std::string* l) {
117 l->append("<ValueState ("); 117 l->append("<ValueState (");
118 for (size_t i = 0; i < sizeof(p.int_value); ++i) 118 for (int value : p.int_value)
119 *l += base::StringPrintf("%i ", p.int_value[i]); 119 *l += base::StringPrintf("%i ", value);
120 l->append(" int values "); 120 l->append(" int values ");
121 for (size_t i = 0; i < sizeof(p.float_value); ++i) 121 for (float value : p.float_value)
122 *l += base::StringPrintf("%f ", p.float_value[i]); 122 *l += base::StringPrintf("%f ", value);
123 l->append(" float values)>"); 123 l->append(" float values)>");
124 } 124 }
125 125
126 } // namespace IPC 126 } // namespace IPC
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