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

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

Issue 1498603002: Handled neutered ImageData in texImage2D and texSubImage2D (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
index ac5365be9cd94b8f831c97bd7977afd3aeb06bde..31a64856333aa2ef295dbcc5fbed6c96c3182098 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -4313,6 +4313,10 @@ void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLenum in
synthesizeGLError(GL_INVALID_VALUE, "texImage2D", "no image data");
return;
}
+ if (pixels->data()->bufferBase()->isNeutered()) {
+ synthesizeGLError(GL_INVALID_VALUE, "texImage2D", "The source data has been neutered.");
+ return;
+ }
if (isContextLost() || !validateTexFunc("texImage2D", NotTexSubImage2D, SourceImageData, target, level, internalformat, pixels->width(), pixels->height(), 0, format, type, 0, 0))
return;
if (type == GL_UNSIGNED_INT_10F_11F_11F_REV) {
@@ -4634,6 +4638,10 @@ void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint
synthesizeGLError(GL_INVALID_VALUE, "texSubImage2D", "no image data");
return;
}
+ if (pixels->data()->bufferBase()->isNeutered()) {
+ synthesizeGLError(GL_INVALID_VALUE, "texSubImage2D", "The source data has been neutered.");
+ return;
+ }
if (isContextLost() || !validateTexFunc("texSubImage2D", TexSubImage2D, SourceImageData, target, level, 0, pixels->width(), pixels->height(), 0, format, type, xoffset, yoffset))
return;
if (type == GL_UNSIGNED_INT_10F_11F_11F_REV) {
« 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