Bug 1289653 - Disallow null `pixels` in texSubImage. - r=mtseng
MozReview-Commit-ID: HgbJEhykEda
--- a/dom/canvas/WebGLTextureUpload.cpp
+++ b/dom/canvas/WebGLTextureUpload.cpp
@@ -257,16 +257,19 @@ WebGLTexture::TexOrSubImage(bool isSubIm
}
if (width && height && depth) {
view.ComputeLengthAndData();
bytes = view.DataAllowShared();
byteCount = view.LengthAllowShared();
}
+ } else if (isSubImage) {
+ mContext->ErrorInvalidValue("%s: `pixels` must not be null.", funcName);
+ return;
}
const bool isClientData = true;
webgl::TexUnpackBytes blob(mContext, target, width, height, depth, isClientData,
bytes);
if (bytes &&
!ValidateUnpackBytes(mContext, funcName, width, height, depth, pi, byteCount,