Bug 1321450 - Check our GLsizei args. - r=ethlin
authorJeff Gilbert <jdashg@gmail.com>
Tue, 06 Dec 2016 14:44:23 -0800
changeset 325320 0d7106de13327e1446d0034c10e7e9986a50a4e7
parent 325319 80afe5f38d073ea432de589bed7451a3a7c8def7
child 325321 5ee72d9b8e3ef32e4dceca79a0682641b7401b83
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersethlin
bugs1321450
milestone53.0a1
Bug 1321450 - Check our GLsizei args. - r=ethlin MozReview-Commit-ID: CEXu5LjgMx6
dom/canvas/WebGL2ContextFramebuffers.cpp
--- 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);