mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 635666 - part 3/3 - WebGL crash [@mozilla::WebGLContext::CopyTexSubImage2D] - r=jrmuizel, a=joe
This commit is contained in:
parent
7b38bd3532
commit
ad8f7fa5c9
@ -882,6 +882,12 @@ public:
|
||||
return const_cast<WebGLTexture*>(this)->ImageInfoAt(level, face);
|
||||
}
|
||||
|
||||
PRBool HasImageInfoAt(size_t level, size_t face) const {
|
||||
return level <= mMaxLevelWithCustomImages &&
|
||||
face < mFacesCount &&
|
||||
ImageInfoAt(level, 0).mIsDefined;
|
||||
}
|
||||
|
||||
static size_t FaceForTarget(WebGLenum target) {
|
||||
return target == LOCAL_GL_TEXTURE_2D ? 0 : target - LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X;
|
||||
}
|
||||
|
@ -809,6 +809,9 @@ WebGLContext::CopyTexSubImage2D(WebGLenum target,
|
||||
return ErrorInvalidOperation("copyTexSubImage2D: no texture bound to this target");
|
||||
|
||||
WebGLint face = WebGLTexture::FaceForTarget(target);
|
||||
if (!tex->HasImageInfoAt(level, face))
|
||||
return ErrorInvalidOperation("copyTexSubImage2D: to texture image previously defined for this level and face");
|
||||
|
||||
WebGLsizei texWidth = tex->ImageInfoAt(level, face).mWidth;
|
||||
WebGLsizei texHeight = tex->ImageInfoAt(level, face).mHeight;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user