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

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp

Issue 1414853008: Validate pixel data array is enough for request by texImage3D and texSubImage3D (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clean rebase Created 5 years, 1 month 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: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
index 3d04ecf6f55805db757caba6b23430516db667ad..dac26cab6ffc2327113cf50988cde6527f8c2f67 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
@@ -663,7 +663,7 @@ bool WebGL2RenderingContextBase::validateTexImage3D(const char* functionName, GL
void WebGL2RenderingContextBase::texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, DOMArrayBufferView* pixels)
{
if (isContextLost() || !validateTexImage3D("texImage3D", target, level, internalformat, width, height, depth, border, format, type)
- || !validateTexFuncData("texImage3D", level, width, height, format, type, pixels, NullAllowed))
+ || !validateTexFuncData("texImage3D", level, width, height, depth, format, type, pixels, NullAllowed))
return;
void* data = pixels ? pixels->baseAddress() : 0;
@@ -767,7 +767,7 @@ void WebGL2RenderingContextBase::texSubImage3DImpl(GLenum target, GLint level, G
void WebGL2RenderingContextBase::texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, DOMArrayBufferView* pixels)
{
if (isContextLost() || !pixels || !validateTexSubImage3D("texSubImage3D", target, level, xoffset, yoffset, zoffset, format, type, width, height, depth)
- || !validateTexFuncData("texSubImage3D", level, width, height, format, type, pixels, NullAllowed))
+ || !validateTexFuncData("texSubImage3D", level, width, height, depth, format, type, pixels, NullAllowed))
return;
// FIXME: Ensure pixels is large enough to contain the desired texture dimensions.

Powered by Google App Engine
This is Rietveld 408576698