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

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

Issue 1272153004: Add glCompressedCopySubTextureCHROMIUM (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: xoffset and yoffset should be validated against destination texture Created 5 years, 4 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/gles2_cmd_copy_texture_chromium.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc b/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc
index 846ac0d6a12b9be9218a3d26a2a866fc87c67292..1ed0af75e3a7022dad84c2320b1a1c17d8996a7e 100644
--- a/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc
+++ b/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc
@@ -471,8 +471,10 @@ void CopyTextureCHROMIUMResourceManager::DoCopyTextureInternal(
DCHECK(source_target == GL_TEXTURE_2D ||
source_target == GL_TEXTURE_RECTANGLE_ARB ||
source_target == GL_TEXTURE_EXTERNAL_OES);
- DCHECK(xoffset >= 0 && xoffset + source_width <= dest_width);
- DCHECK(yoffset >= 0 && yoffset + source_height <= dest_height);
+ DCHECK_GE(xoffset, 0);
+ DCHECK_LE(xoffset + width, dest_width);
+ DCHECK_GE(yoffset, 0);
+ DCHECK_LE(yoffset + height, dest_height);
if (!initialized_) {
DLOG(ERROR) << "CopyTextureCHROMIUM: Uninitialized manager.";
return;

Powered by Google App Engine
This is Rietveld 408576698