Bug 1321450 - Check our GLsizei args. - r=ethlin
MozReview-Commit-ID: CEXu5LjgMx6
--- a/dom/canvas/WebGL2ContextFramebuffers.cpp
+++ b/dom/canvas/WebGL2ContextFramebuffers.cpp
@@ -265,16 +265,22 @@ WebGL2Context::InvalidateSubFramebuffer(
GLsizei glNumAttachments;
const GLenum* glAttachments;
if (!ValidateInvalidateFramebuffer(funcName, target, attachments, &rv, &scopedVector,
&glNumAttachments, &glAttachments))
{
return;
}
+ if (!ValidateNonNegative(funcName, "width", width) ||
+ !ValidateNonNegative(funcName, "height", height))
+ {
+ return;
+ }
+
////
// Some drivers (like OSX 10.9 GL) just don't support invalidate_framebuffer.
const bool useFBInvalidation = (mAllowFBInvalidation &&
gl->IsSupported(gl::GLFeature::invalidate_framebuffer));
if (useFBInvalidation) {
gl->fInvalidateSubFramebuffer(target, glNumAttachments, glAttachments, x, y,
width, height);