Changeset 265401 in webkit


Ignore:
Timestamp:
Aug 7, 2020 5:31:25 PM (4 years ago)
Author:
commit-queue@webkit.org
Message:

[WebGL2] Missing validation for sampler unit index
https://bugs.webkit.org/show_bug.cgi?id=215303

Patch by James Darpinian <James Darpinian> on 2020-08-07
Reviewed by Dean Jackson.

Test: webgl/2.0.0/deqp/functional/gles3/negativeshaderapi.html

  • html/canvas/WebGL2RenderingContext.cpp:

(WebCore::WebGL2RenderingContext::bindSampler):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r265399 r265401  
     12020-08-07  James Darpinian  <jdarpinian@chromium.org>
     2
     3        [WebGL2] Missing validation for sampler unit index
     4        https://bugs.webkit.org/show_bug.cgi?id=215303
     5
     6        Reviewed by Dean Jackson.
     7
     8        Test: webgl/2.0.0/deqp/functional/gles3/negativeshaderapi.html
     9
     10        * html/canvas/WebGL2RenderingContext.cpp:
     11        (WebCore::WebGL2RenderingContext::bindSampler):
     12
    1132020-08-07  James Darpinian  <jdarpinian@chromium.org>
    214
  • trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp

    r265399 r265401  
    19881988void WebGL2RenderingContext::bindSampler(GCGLuint unit, WebGLSampler* sampler)
    19891989{
    1990     if (isContextLostOrPending() || m_boundSamplers[unit] == sampler)
    1991         return;
     1990    if (isContextLostOrPending())
     1991        return;
     1992   
     1993    if (unit >= m_boundSamplers.size()) {
     1994        synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "bindSampler", "invalid texture unit");
     1995        return;
     1996    }
    19921997
    19931998    if (sampler && sampler->isDeleted()) {
     
    19962001    }
    19972002
     2003    if (m_boundSamplers[unit] == sampler)
     2004        return;
    19982005    m_context->bindSampler(unit, objectOrZero(sampler));
    19992006    m_boundSamplers[unit] = sampler;
Note: See TracChangeset for help on using the changeset viewer.