Closed Bug 911850 Opened 6 years ago Closed 6 years ago

BindBufferRange should check for out-of-bounds range

Categories

(Core :: Canvas: WebGL, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: bjacob, Assigned: bjacob)

Details

Attachments

(1 file)

... rather than trusting the underlying GL to get it right.
Attachment #798634 - Flags: review?(jgilbert)
Oups... good catch! =D
Comment on attachment 798634 [details] [diff] [review]
Let BindBufferRange check the range

Review of attachment 798634 [details] [diff] [review]:
-----------------------------------------------------------------

Nit.

::: content/canvas/src/WebGLContextBuffers.cpp
@@ +113,5 @@
>          } else if (target != buffer->Target()) {
>              return ErrorInvalidOperation("bindBuffer: buffer already bound to a different target");
>          }
> +        CheckedInt<WebGLsizeiptr> checked_neededByteLength = CheckedInt<WebGLsizeiptr>(offset) + size;
> +        if (!checked_neededByteLength.isValid() || checked_neededByteLength.value() > buffer->ByteLength()) {

Can we put these two conditions on separate lines?
Attachment #798634 - Flags: review?(jgilbert) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/49daf6b00b8f
Assignee: nobody → bjacob
Target Milestone: --- → mozilla26
https://hg.mozilla.org/mozilla-central/rev/49daf6b00b8f
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.