summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorcevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-12 20:50:10 +0000
committercevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-12 20:50:10 +0000
commit4fd8afbe39b2f894c21d58ac12602f53d9896dcf (patch)
treeaf6e8fa25b6f2001917a6ecc592fe2e34ff7bd68 /gpu
parent2609751bb1774e1a85a67ce642d88ad7c62965e1 (diff)
downloadchromium_src-4fd8afbe39b2f894c21d58ac12602f53d9896dcf.zip
chromium_src-4fd8afbe39b2f894c21d58ac12602f53d9896dcf.tar.gz
chromium_src-4fd8afbe39b2f894c21d58ac12602f53d9896dcf.tar.bz2
Land http://src.chromium.org/viewvc/chrome?view=rev&revision=125984 to trunk.
BUG=125984 TBR=apatrick Review URL: https://chromiumcodereview.appspot.com/9693011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126213 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/common/gles2_cmd_format.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/gpu/command_buffer/common/gles2_cmd_format.h b/gpu/command_buffer/common/gles2_cmd_format.h
index 5120b39..a2b3139 100644
--- a/gpu/command_buffer/common/gles2_cmd_format.h
+++ b/gpu/command_buffer/common/gles2_cmd_format.h
@@ -91,7 +91,8 @@ struct SizedResult {
// 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.