Bug 1300946 - Binding a deleted TFO should be INVALID_OP. - r=ethlin
MozReview-Commit-ID: 6TZsKiGHc5v
--- 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;
}