Commit 851cd580 by Geoff Lang

Check for null attribute buffers before binding.

Fixes: * Crash in conformance/extensions/oes-vertex-array-object.html BUG=angleproject:880 Change-Id: I90eba9b26b2834644ce3ba0e78cab3417c2a7bd1 Reviewed-on: https://chromium-review.googlesource.com/273325Tested-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarBrandon Jones <bajones@chromium.org> Reviewed-by: 's avatarKenneth Russell <kbr@chromium.org>
parent 4f1af784
...@@ -209,8 +209,15 @@ gl::Error VertexArrayGL::syncAttributeState(bool attributesNeedStreaming, const ...@@ -209,8 +209,15 @@ gl::Error VertexArrayGL::syncAttributeState(bool attributesNeedStreaming, const
if (mAppliedAttributes[idx] != mAttributes[idx]) if (mAppliedAttributes[idx] != mAttributes[idx])
{ {
const gl::Buffer *arrayBuffer = mAttributes[idx].buffer.get(); const gl::Buffer *arrayBuffer = mAttributes[idx].buffer.get();
const BufferGL *arrayBufferGL = GetImplAs<BufferGL>(arrayBuffer); if (arrayBuffer != nullptr)
mStateManager->bindBuffer(GL_ARRAY_BUFFER, arrayBufferGL->getBufferID()); {
const BufferGL *arrayBufferGL = GetImplAs<BufferGL>(arrayBuffer);
mStateManager->bindBuffer(GL_ARRAY_BUFFER, arrayBufferGL->getBufferID());
}
else
{
mStateManager->bindBuffer(GL_ARRAY_BUFFER, 0);
}
if (mAttributes[idx].pureInteger) if (mAttributes[idx].pureInteger)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment