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

Unified Diff: gpu/command_buffer/service/common_decoder.cc

Issue 2764403002: Make sure buffers are large enough to hold the Result structure. (Closed)
Patch Set: Created 3 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
Index: gpu/command_buffer/service/common_decoder.cc
diff --git a/gpu/command_buffer/service/common_decoder.cc b/gpu/command_buffer/service/common_decoder.cc
index b879f9572d3848dbfc06253653c12f5c6b861b45..a561056e3542bd7afd19df4c1c9af89f9bb4d2de 100644
--- a/gpu/command_buffer/service/common_decoder.cc
+++ b/gpu/command_buffer/service/common_decoder.cc
@@ -143,10 +143,11 @@ void* CommonDecoder::GetAddressAndCheckSize(unsigned int shm_id,
void* CommonDecoder::GetAddressAndSize(unsigned int shm_id,
unsigned int data_offset,
+ unsigned int minimum_size,
unsigned int* data_size) {
CHECK(engine_);
scoped_refptr<gpu::Buffer> buffer = engine_->GetSharedMemoryBuffer(shm_id);
- if (!buffer.get())
+ if (!buffer.get() || buffer->GetRemainingSize(data_offset) < minimum_size)
return NULL;
return buffer->GetDataAddressAndSize(data_offset, data_size);
}
« no previous file with comments | « gpu/command_buffer/service/common_decoder.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698