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. |