diff options
author | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-08 18:21:00 +0000 |
---|---|---|
committer | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-08 18:21:00 +0000 |
commit | 7e5bee5034d8fdcab1ac7f15726bb08227af27fd (patch) | |
tree | 7cfd8002a32e0bbba217254e0d06e8ce448bd271 /gpu | |
parent | 0a9b08f93655756a53cbcaf5496ec5efcc302cb7 (diff) | |
download | chromium_src-7e5bee5034d8fdcab1ac7f15726bb08227af27fd.zip chromium_src-7e5bee5034d8fdcab1ac7f15726bb08227af27fd.tar.gz chromium_src-7e5bee5034d8fdcab1ac7f15726bb08227af27fd.tar.bz2 |
Fixed a command buffer wrap around bug.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/668212
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40910 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/command_buffer/client/cmd_buffer_helper.cc | 4 | ||||
-rw-r--r-- | gpu/command_buffer/service/command_buffer_service.cc | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/gpu/command_buffer/client/cmd_buffer_helper.cc b/gpu/command_buffer/client/cmd_buffer_helper.cc index 2fe8b66..ed04e30 100644 --- a/gpu/command_buffer/client/cmd_buffer_helper.cc +++ b/gpu/command_buffer/client/cmd_buffer_helper.cc @@ -139,6 +139,10 @@ CommandBufferEntry* CommandBufferHelper::GetSpace(uint32 entries) { WaitForAvailableEntries(entries); CommandBufferEntry* space = &entries_[put_]; put_ += entries; + DCHECK_LE(put_, entry_count_); + if (put_ == entry_count_) { + put_ = 0; + } return space; } diff --git a/gpu/command_buffer/service/command_buffer_service.cc b/gpu/command_buffer/service/command_buffer_service.cc index 797d9a5..8dca2f6 100644 --- a/gpu/command_buffer/service/command_buffer_service.cc +++ b/gpu/command_buffer/service/command_buffer_service.cc @@ -70,7 +70,7 @@ CommandBufferService::State CommandBufferService::GetState() { } CommandBufferService::State CommandBufferService::Flush(int32 put_offset) { - if (put_offset < 0 || put_offset >= size_) { + if (put_offset < 0 || put_offset > size_) { error_ = gpu::error::kOutOfBounds; return GetState(); } |