Bug 1316539 - Do null TexSubImage check with blob->HasData(). - r=lenzak800
MozReview-Commit-ID: LwRZQI2dcKO
--- a/dom/canvas/WebGLTextureUpload.cpp
+++ b/dom/canvas/WebGLTextureUpload.cpp
@@ -439,16 +439,21 @@ WebGLTexture::TexSubImage(const char* fu
{
const GLint border = 0;
dom::RootedTypedArray<dom::Uint8ClampedArray> scopedArr(dom::RootingCx());
const auto blob = ValidateTexOrSubImage(mContext, funcName, target, width, height,
depth, border, pi, src, &scopedArr);
if (!blob)
return;
+ if (!blob->HasData()) {
+ mContext->ErrorInvalidValue("%s: Source must not be null.", funcName);
+ return;
+ }
+
TexSubImage(funcName, target, level, xOffset, yOffset, zOffset, pi, blob.get());
}
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
static bool
ValidateTexImage(WebGLContext* webgl, WebGLTexture* texture, const char* funcName,