Bug 163715 - Passing a number as the pixel parameter to texImage2D() doesn't thrown an exception
Summary: Passing a number as the pixel parameter to texImage2D() doesn't thrown an exc...
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
Depends on:
Reported: 2016-10-19 18:29 PDT by Myles C. Maxfield
Modified: 2016-10-20 12:55 PDT (History)
7 users (show)

See Also:

Test (5.08 KB, patch)
2016-10-20 10:15 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (8.34 KB, patch)
2016-10-20 11:51 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2016-10-19 18:29:53 PDT
The IDL bindings code converts the argument

ArrayBufferView? pixels


auto pixels = toArrayBufferView(state->uncheckedArgument(8));

inside JSWebGLRenderingContextBase.cpp

toArrayBufferView returns nullptr if the input is a wrong type, so this case is indistinguishable from passing "null" in javascript.

However, passing an unknown type should throw an exception, and passing "null" should cause "a buffer of sufficient size initialized to 0 is passed."
Comment 1 Myles C. Maxfield 2016-10-20 10:15:24 PDT
Created attachment 292219 [details]
Comment 3 Chris Dumez 2016-10-20 10:23:43 PDT
Thanks, I am looking into it.
Comment 4 Chris Dumez 2016-10-20 11:51:16 PDT
Created attachment 292233 [details]
Comment 5 Myles C. Maxfield 2016-10-20 12:17:18 PDT
Comment 6 WebKit Commit Bot 2016-10-20 12:55:01 PDT
Comment on attachment 292233 [details]

Clearing flags on attachment: 292233

Committed r207634: <http://trac.webkit.org/changeset/207634>
Comment 7 WebKit Commit Bot 2016-10-20 12:55:06 PDT
All reviewed patches have been landed.  Closing bug.