summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorteravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-10 18:30:38 +0000
committerteravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-10 18:30:38 +0000
commitf20c815b1a8aa063f6a3a32995f6a460b41a72e4 (patch)
tree9cef548afbebbe90ccfa91aa43e1abde11d03980 /gpu
parent28564c32f816a1ad87285c9445fc8c83ba2e40c1 (diff)
downloadchromium_src-f20c815b1a8aa063f6a3a32995f6a460b41a72e4.zip
chromium_src-f20c815b1a8aa063f6a3a32995f6a460b41a72e4.tar.gz
chromium_src-f20c815b1a8aa063f6a3a32995f6a460b41a72e4.tar.bz2
GPU: Set id to -1 on failure creating transfer buffer.
Some code depends on id being set to -1 when CreateTransferBuffer() fails. I believe this is related to some reported crashes, though I can't reproduce the crashes to confirm. Regardless, this is more correct than the behavior today. BUG=172338 Review URL: https://chromiumcodereview.appspot.com/14779013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199509 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/service/command_buffer_service.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/gpu/command_buffer/service/command_buffer_service.cc b/gpu/command_buffer/service/command_buffer_service.cc
index 32cb354..015d643 100644
--- a/gpu/command_buffer/service/command_buffer_service.cc
+++ b/gpu/command_buffer/service/command_buffer_service.cc
@@ -137,8 +137,10 @@ Buffer CommandBufferService::CreateTransferBuffer(size_t size,
static int32 next_id = 1;
*id = next_id++;
- if (!RegisterTransferBuffer(*id, &buffer, size))
+ if (!RegisterTransferBuffer(*id, &buffer, size)) {
+ *id = -1;
return Buffer();
+ }
return GetTransferBuffer(*id);
}