Changeset 207221 in webkit


Ignore:
Timestamp:
Oct 12, 2016 9:50:24 AM (8 years ago)
Author:
Brent Fulgham
Message:

[WebGL] Revise vertex array attribute checks to account for lazy memory allocation.
https://bugs.webkit.org/show_bug.cgi?id=163149
<rdar://problem/28629774>

Reviewed by Dean Jackson.

Tested by fast/canvas/webgl/webgl-drawarrays-crash-2.html

  • html/canvas/WebGLRenderingContextBase.cpp:

(WebCore::WebGLRenderingContextBase::validateVertexAttributes):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r207220 r207221  
     12016-10-12  Brent Fulgham  <bfulgham@apple.com>
     2
     3        [WebGL] Revise vertex array attribute checks to account for lazy memory allocation.
     4        https://bugs.webkit.org/show_bug.cgi?id=163149
     5        <rdar://problem/28629774>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Tested by fast/canvas/webgl/webgl-drawarrays-crash-2.html
     10
     11        * html/canvas/WebGLRenderingContextBase.cpp:
     12        (WebCore::WebGLRenderingContextBase::validateVertexAttributes):
     13
    1142016-10-12  Wenson Hsieh  <wenson_hsieh@apple.com>
    215
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp

    r205405 r207221  
    17571757        return false;
    17581758
     1759    bool usingSimulatedArrayBuffer = m_currentProgram->isUsingVertexAttrib0();
     1760
    17591761    // Guard against access into non-existent buffers.
    1760     if (elementCount && !sawEnabledAttrib && !m_currentProgram->isUsingVertexAttrib0())
     1762    if (elementCount && !sawEnabledAttrib && !usingSimulatedArrayBuffer)
    17611763        return false;
    17621764
    17631765    if (elementCount && sawEnabledAttrib) {
    1764         if (!m_boundArrayBuffer && !m_boundVertexArrayObject->getElementArrayBuffer())
     1766        if (!m_boundArrayBuffer && !m_boundVertexArrayObject->getElementArrayBuffer()) {
     1767            if (usingSimulatedArrayBuffer) {
     1768                auto& state = m_boundVertexArrayObject->getVertexAttribState(0);
     1769                if (state.enabled && state.isBound()) {
     1770                    if (state.bufferBinding->getTarget() == GraphicsContext3D::ARRAY_BUFFER || state.bufferBinding->getTarget() == GraphicsContext3D::ELEMENT_ARRAY_BUFFER)
     1771                        return !!state.bufferBinding->byteLength();
     1772                }
     1773            }
    17651774            return false;
     1775        }
    17661776    }
    17671777   
Note: See TracChangeset for help on using the changeset viewer.