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

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

Issue 2043983002: gpu: Disallow null client ids in Gen* functions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 6d4bacbfa7f941e3cfcf8a1855a3e1b36c2770ab..3d8bcadb0cda8446a3d73a1a02f4369ab7c4bf0e 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -193,11 +193,12 @@ GLuint GetServiceId(const OBJECT_TYPE* object) {
return object ? object->service_id() : 0;
}
-bool CheckUniqueIds(GLsizei n, const GLuint* client_ids) {
+bool CheckUniqueAndNonNullIds(GLsizei n, const GLuint* client_ids) {
if (n <= 0)
return true;
std::unordered_set<uint32_t> unique_ids(client_ids, client_ids + n);
- return unique_ids.size() == static_cast<size_t>(n);
+ return (unique_ids.size() == static_cast<size_t>(n)) &&
+ (unique_ids.find(0) == unique_ids.end());
}
struct Vec4f {
« no previous file with comments | « gpu/command_buffer/build_gles2_cmd_buffer.py ('k') | gpu/command_buffer/service/gles2_cmd_decoder_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698