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

Unified Diff: gpu/command_buffer/client/vertex_array_object_manager.cc

Issue 2177513002: gpu: Avoid integer overflow when setting up client side buffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/client/vertex_array_object_manager.cc
diff --git a/gpu/command_buffer/client/vertex_array_object_manager.cc b/gpu/command_buffer/client/vertex_array_object_manager.cc
index 315032d34e2ae33e0566077f0cfaca8ce8956d79..453de8cde75e70c26058b7209c210f49c04265b4 100644
--- a/gpu/command_buffer/client/vertex_array_object_manager.cc
+++ b/gpu/command_buffer/client/vertex_array_object_manager.cc
@@ -486,6 +486,11 @@ bool VertexArrayObjectManager::IsDefaultVAOBound() const {
return bound_vertex_array_object_ == default_vertex_array_object_;
}
+bool VertexArrayObjectManager::SupportsClientSideBuffers() {
+ return support_client_side_arrays_ &&
+ bound_vertex_array_object_->HaveEnabledClientSideBuffers();
+}
+
// Returns true if buffers were setup.
bool VertexArrayObjectManager::SetupSimulatedClientSideBuffers(
const char* function_name,
@@ -495,11 +500,9 @@ bool VertexArrayObjectManager::SetupSimulatedClientSideBuffers(
GLsizei primcount,
bool* simulated) {
*simulated = false;
- if (!support_client_side_arrays_)
- return true;
- if (!bound_vertex_array_object_->HaveEnabledClientSideBuffers()) {
- return true;
- }
+ if (!SupportsClientSideBuffers())
+ return false;
+
if (!IsDefaultVAOBound()) {
gl->SetGLError(
GL_INVALID_OPERATION, function_name,

Powered by Google App Engine
This is Rietveld 408576698