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

Unified Diff: gpu/command_buffer/common/gles2_cmd_format.h

Issue 9693011: Land http://src.chromium.org/viewvc/chrome?view=rev&revision=125984 to trunk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/common/gles2_cmd_format.h
===================================================================
--- gpu/command_buffer/common/gles2_cmd_format.h (revision 125750)
+++ gpu/command_buffer/common/gles2_cmd_format.h (working copy)
@@ -91,7 +91,8 @@
// Returns the maximum number of results for a given buffer size.
static uint32 ComputeMaxResults(size_t size_of_buffer) {
- return (size_of_buffer - sizeof(uint32)) / sizeof(T); // NOLINT
+ return (size_of_buffer >= sizeof(uint32)) ?
+ ((size_of_buffer - sizeof(uint32)) / sizeof(T)) : 0; // NOLINT
}
// Set the size for a given number of results.
« 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