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

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

Issue 2751553002: Check for invalid dimensions in glTexStorage* (Closed)
Patch Set: comment 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
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 90939e70c32fb54088fd0d8800247ee00266b781..2c5237cab03c8ad80128c0416bded7660c48f62e 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -17148,9 +17148,14 @@ void GLES2DecoderImpl::TexStorageImpl(GLenum target,
GL_INVALID_OPERATION, function_name, "target invalid for format");
return;
}
+ // The glTexStorage entry points require width, height, and depth to be
+ // at least 1, but the other texture entry points (those which use
+ // ValidForTarget) do not. So we have to add an extra check here.
+ bool is_invalid_texstorage_size = width < 1 || height < 1 || depth < 1;
if (!texture_manager()->ValidForTarget(target, 0, width, height, depth) ||
- TextureManager::ComputeMipMapCount(
- target, width, height, depth) < levels) {
+ is_invalid_texstorage_size ||
+ TextureManager::ComputeMipMapCount(target, width, height, depth) <
+ levels) {
LOCAL_SET_GL_ERROR(
GL_INVALID_VALUE, function_name, "dimensions out of range");
return;
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698