⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243506 in webkit


Ignore:
Timestamp:
Mar 26, 2019, 11:00:55 AM (7 years ago)
Author:
dino@apple.com
Message:

vertexAttribPointer must restrict offset parameter
https://bugs.webkit.org/show_bug.cgi?id=196261
<rdar://problem/48458086>

Reviewed by Antoine Quint.

Source/WebCore:

This WebGL function should fail if the offset parameter is
not within [0, max 32-bit int].

Test: fast/canvas/webgl/vertexAttribPointer-with-bad-offset.html

  • html/canvas/WebGLRenderingContextBase.cpp:

(WebCore::WebGLRenderingContextBase::vertexAttribPointer):

LayoutTests:

Add a test where the offset parameter is out of bounds.

  • fast/canvas/webgl/vertexAttribPointer-with-bad-offset-expected.txt: Added.
  • fast/canvas/webgl/vertexAttribPointer-with-bad-offset.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r243503 r243506  
     12019-03-26  Dean Jackson  <dino@apple.com>
     2
     3        vertexAttribPointer must restrict offset parameter
     4        https://bugs.webkit.org/show_bug.cgi?id=196261
     5        <rdar://problem/48458086>
     6
     7        Reviewed by Antoine Quint.
     8
     9        Add a test where the offset parameter is out of bounds.
     10
     11        * fast/canvas/webgl/vertexAttribPointer-with-bad-offset-expected.txt: Added.
     12        * fast/canvas/webgl/vertexAttribPointer-with-bad-offset.html: Added.
     13
    1142019-03-26  Zalan Bujtas  <zalan@apple.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r243504 r243506  
     12019-03-26  Dean Jackson  <dino@apple.com>
     2
     3        vertexAttribPointer must restrict offset parameter
     4        https://bugs.webkit.org/show_bug.cgi?id=196261
     5        <rdar://problem/48458086>
     6
     7        Reviewed by Antoine Quint.
     8
     9        This WebGL function should fail if the offset parameter is
     10        not within [0, max 32-bit int].
     11
     12        Test: fast/canvas/webgl/vertexAttribPointer-with-bad-offset.html
     13
     14        * html/canvas/WebGLRenderingContextBase.cpp:
     15        (WebCore::WebGLRenderingContextBase::vertexAttribPointer):
     16
    1172019-03-26  Antoine Quint  <graouts@apple.com>
    218
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp

    r243400 r243506  
    50015001        return;
    50025002    }
    5003     if (size < 1 || size > 4 || stride < 0 || stride > 255 || offset < 0) {
    5004         synthesizeGLError(GraphicsContext3D::INVALID_VALUE, "vertexAttribPointer", "bad size, stride or offset");
     5003    if (size < 1 || size > 4) {
     5004        synthesizeGLError(GraphicsContext3D::INVALID_VALUE, "vertexAttribPointer", "bad size");
     5005        return;
     5006    }
     5007    if (stride < 0 || stride > 255) {
     5008        synthesizeGLError(GraphicsContext3D::INVALID_VALUE, "vertexAttribPointer", "bad stride");
     5009        return;
     5010    }
     5011    if (offset < 0 || offset > std::numeric_limits<int32_t>::max()) {
     5012        synthesizeGLError(GraphicsContext3D::INVALID_VALUE, "vertexAttribPointer", "bad offset");
    50055013        return;
    50065014    }
Note: See TracChangeset for help on using the changeset viewer.