Clarify what we're testing. r?jrmuizel
draft
Clarify what we're testing. r?jrmuizel
From a2553704a36aee463e33df74c0b023ec4cf86ba8 Mon Sep 17 00:00:00 2001
---
dom/canvas/WebGLContextDraw.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
MozReview-Commit-ID: BYiQRuQfIq9
--- a/dom/canvas/WebGLContextDraw.cpp
+++ b/dom/canvas/WebGLContextDraw.cpp
@@ -355,18 +355,20 @@ WebGLContext::DrawElements_check(GLsizei
const GLsizei first = byteOffset / bytesPerElem;
const CheckedUint32 checked_byteCount = bytesPerElem * CheckedUint32(count);
if (!checked_byteCount.isValid()) {
ErrorInvalidValue("%s: overflow in byteCount", info);
return false;
}
- // Any checks below this depend on a program being available.
- if (!mCurrentProgram) {
+ // Any checks below this depend on mActiveProgramLinkInfo being available.
+ if (!mActiveProgramLinkInfo) {
+ // Technically, this will only be null iff CURRENT_PROGRAM is null.
+ // But it's better to branch on what we actually care about.
ErrorInvalidOperation("%s: null CURRENT_PROGRAM", info);
return false;
}
if (!mBoundVertexArray->mElementArrayBuffer) {
ErrorInvalidOperation("%s: must have element array buffer binding", info);
return false;
}