Bug 163715

Summary: Passing a number as the pixel parameter to texImage2D() doesn't thrown an exception
Product: WebKit Reporter: Myles C. Maxfield <mmaxfield>
Component: WebGLAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, darin, dino, ggaren, rniwa, sam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Test
none
Patch none

Description Myles C. Maxfield 2016-10-19 18:29:53 PDT
The IDL bindings code converts the argument

ArrayBufferView? pixels

to

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]
Test
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]
Patch
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]
Patch

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.