mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1156980 - Validate target in ImageData variants of TexImage2D/TexSubImage2D. r=jgilbert
This commit is contained in:
parent
ec963b4d8e
commit
29f0f96441
@ -637,6 +637,10 @@ public:
|
||||
GLint yoffset, GLenum format, GLenum type,
|
||||
ElementType& elt, ErrorResult& rv)
|
||||
{
|
||||
// TODO: Consolidate all the parameter validation
|
||||
// checks. Instead of spreading out the cheks in multple
|
||||
// places, consolidate into one spot.
|
||||
|
||||
if (IsContextLost())
|
||||
return;
|
||||
|
||||
@ -1308,7 +1312,7 @@ protected:
|
||||
GLenum format, GLenum type, void* data,
|
||||
uint32_t byteLength, js::Scalar::Type jsArrayType,
|
||||
WebGLTexelFormat srcFormat, bool srcPremultiplied);
|
||||
void TexSubImage2D_base(TexImageTarget texImageTarget, GLint level,
|
||||
void TexSubImage2D_base(GLenum texImageTarget, GLint level,
|
||||
GLint xoffset, GLint yoffset, GLsizei width,
|
||||
GLsizei height, GLsizei srcStrideOrZero,
|
||||
GLenum format, GLenum type, void* pixels,
|
||||
|
@ -3423,7 +3423,7 @@ WebGLContext::TexImage2D(GLenum rawTarget, GLint level,
|
||||
|
||||
|
||||
void
|
||||
WebGLContext::TexSubImage2D_base(TexImageTarget texImageTarget, GLint level,
|
||||
WebGLContext::TexSubImage2D_base(GLenum rawImageTarget, GLint level,
|
||||
GLint xoffset, GLint yoffset,
|
||||
GLsizei width, GLsizei height, GLsizei srcStrideOrZero,
|
||||
GLenum format, GLenum type,
|
||||
@ -3437,6 +3437,11 @@ WebGLContext::TexSubImage2D_base(TexImageTarget texImageTarget, GLint level,
|
||||
if (type == LOCAL_GL_HALF_FLOAT_OES)
|
||||
type = LOCAL_GL_HALF_FLOAT;
|
||||
|
||||
if (!ValidateTexImageTarget(rawImageTarget, func, dims))
|
||||
return;
|
||||
|
||||
TexImageTarget texImageTarget(rawImageTarget);
|
||||
|
||||
WebGLTexture* tex = ActiveBoundTextureForTexImageTarget(texImageTarget);
|
||||
if (!tex)
|
||||
return ErrorInvalidOperation("texSubImage2D: no texture bound on active texture unit");
|
||||
|
Loading…
Reference in New Issue
Block a user