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

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

Issue 1749183003: Command buffer: generate correct GL error for invalid level for compressed texture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed zmo@'s feedback Created 4 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 | no next file » | 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 a3ad42338965a9e9f7e5c85fb6e133d83079545d..ca922438ca23ea5bbf51ee36d3400b98e8f397ff 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -11117,9 +11117,10 @@ void GLES2DecoderImpl::DoCompressedTexSubImage3D(
"glCompressedTexSubImage3D", format, "format");
return;
}
- if (width < 0 || height < 0 || depth < 0) {
+ if (!texture_manager()->ValidForTarget(target, level, width, height, depth)) {
LOCAL_SET_GL_ERROR(
- GL_INVALID_VALUE, "glCompressedTexSubImage3D", "size < 0");
+ GL_INVALID_VALUE,
+ "glCompressedTexSubImage3D", "dimensions out of range");
return;
}
if (image_size < 0) {
@@ -11341,6 +11342,12 @@ void GLES2DecoderImpl::DoCompressedTexSubImage2D(
"glCompressedTexSubImage2D", "unknown texture for target");
return;
}
+ if (!texture_manager()->ValidForTarget(target, level, width, height, 1)) {
+ LOCAL_SET_GL_ERROR(
+ GL_INVALID_VALUE,
+ "glCompressedTexSubImage2D", "dimensions out of range");
+ return;
+ }
Texture* texture = texture_ref->texture();
GLenum type = 0;
GLenum internal_format = 0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698