Bug 53626 - bufferData and bufferSubData should generate INVALID_VALUE with negative input
Summary: bufferData and bufferSubData should generate INVALID_VALUE with negative input
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Zhenyao Mo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-02 13:46 PST by Zhenyao Mo
Modified: 2011-02-02 14:39 PST (History)
3 users (show)

See Also:


Attachments
Patch (4.49 KB, patch)
2011-02-02 14:02 PST, Zhenyao Mo
kbr: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zhenyao Mo 2011-02-02 13:46:50 PST
Originally since we used the unsigned types we don't have the logic to check if these inputs are non-negative or not.

Now we use the correct signed types, we should check if they are negative or not and generate an INVALID_VALUE error if they are.
Comment 1 Zhenyao Mo 2011-02-02 14:02:39 PST
Created attachment 80966 [details]
Patch
Comment 2 Zhenyao Mo 2011-02-02 14:03:17 PST
The test is in sync with khronos.
Comment 3 Kenneth Russell 2011-02-02 14:16:29 PST
Comment on attachment 80966 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=80966&action=review

Looks good; one more test case is needed though.

> LayoutTests/fast/canvas/webgl/buffer-data-array-buffer.html:44
> +glErrorShouldBe(gl, gl.INVALID_VALUE);

Please also test the bufferSubData entry point taking ArrayBufferView.
Comment 4 Zhenyao Mo 2011-02-02 14:38:38 PST
Will do.
Comment 5 Zhenyao Mo 2011-02-02 14:39:51 PST
Committed r77421: <http://trac.webkit.org/changeset/77421>