Bug 1300946 - Binding a deleted TFO should be INVALID_OP. - r=ethlin a=ritu
authorJeff Gilbert (:jgilbert) <jgilbert@mozilla.com>
Mon, 19 Sep 2016 13:20:15 -0700
changeset 355846 10d4c1119501dac47d2a75d0aa0be94b5818cdd9
parent 355845 3c7bf5fec116441701eeb2355937ccd92681babb
child 355847 f2ec118dca15813a344b599252fd2066929f5c97
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersethlin, ritu
bugs1300946
milestone51.0a2
Bug 1300946 - Binding a deleted TFO should be INVALID_OP. - r=ethlin a=ritu MozReview-Commit-ID: 6TZsKiGHc5v
dom/canvas/WebGL2ContextTransformFeedback.cpp
--- a/dom/canvas/WebGL2ContextTransformFeedback.cpp
+++ b/dom/canvas/WebGL2ContextTransformFeedback.cpp
@@ -71,19 +71,22 @@ WebGL2Context::BindTransformFeedback(GLe
 {
     const char funcName[] = "bindTransformFeedback";
     if (IsContextLost())
         return;
 
     if (target != LOCAL_GL_TRANSFORM_FEEDBACK)
         return ErrorInvalidEnum("%s: `target` must be TRANSFORM_FEEDBACK.", funcName);
 
-    if (!ValidateObjectAllowNull(funcName, tf))
+    if (!ValidateObjectAllowDeletedOrNull(funcName, tf))
         return;
 
+    if (tf && tf->IsDeleted())
+        return ErrorInvalidOperation("%s: TFO already deleted.", funcName);
+
     if (mBoundTransformFeedback->mIsActive &&
         !mBoundTransformFeedback->mIsPaused)
     {
         ErrorInvalidOperation("%s: Currently bound transform feedback is active and not"
                               " paused.",
                               funcName);
         return;
     }