ValhallaTeam / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

Emulated primitive counts require clamping #444

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, we calculate the amount of space needed to store index buffers for 
emulated primitive types (line loops and triangle fans) directly from the 
primitive count passed in via glDrawArrays or glDrawElements. Count values of 
sufficient size could potentially overflow the integer we use to store the 
calculated size. We should check this value before attempting to use it to 
reserve buffer space.

This should be addressed on all three branches. On the legacy branch, it will 
only affect line loops.

Original issue reported on code.google.com by shannonw...@chromium.org on 8 Jul 2013 at 10:59

GoogleCodeExporter commented 9 years ago
Geoff, would you mind taking care of implementing these checks, please?

Original comment by shannonw...@chromium.org on 8 Jul 2013 at 11:01

GoogleCodeExporter commented 9 years ago
Patches for es3 branch.

Original comment by geofflang@chromium.org on 9 Jul 2013 at 9:30

Attachments:

GoogleCodeExporter commented 9 years ago
Patches for d3d11 branch.

Original comment by geofflang@chromium.org on 9 Jul 2013 at 9:31

Attachments:

GoogleCodeExporter commented 9 years ago
Patches for legacy.

Original comment by geofflang@chromium.org on 9 Jul 2013 at 9:31

Attachments:

GoogleCodeExporter commented 9 years ago
For peer review, please.

Original comment by shannonw...@chromium.org on 9 Jul 2013 at 9:41

GoogleCodeExporter commented 9 years ago
Looks good, patches approved. We may want to use size_t when we use any 
instance of sizeof (i.e. in patch 0001)

Original comment by jamie.ma...@transgaming.com on 10 Jul 2013 at 7:09

GoogleCodeExporter commented 9 years ago
[0001-Protect-against-integer-overflows-when-generating-in.patch]
  * Would you mind throwing parens around the max() / sizeof(type) operations in each of the comparisons? Would be slightly easier to read.
  * Jamie's point about size_t is a good one-- it'd be better to use sizeof.

Patches otherwise LGTM. Approved with those nits fixed on checkin.

Original comment by shannonw...@google.com on 10 Jul 2013 at 7:53

GoogleCodeExporter commented 9 years ago

Original comment by geofflang@chromium.org on 11 Jul 2013 at 4:56

GoogleCodeExporter commented 9 years ago
Landed in master at r7891ba and legacy at r5d1cff. es3proto branch fix will 
land at next milestone.

Original comment by shannonw...@google.com on 11 Jul 2013 at 5:23

GoogleCodeExporter commented 9 years ago
Reopened for follow-on work.

Original comment by shannonw...@chromium.org on 31 Jul 2013 at 8:46

GoogleCodeExporter commented 9 years ago
For review.

Original comment by geofflang@chromium.org on 31 Jul 2013 at 9:03

Attachments:

GoogleCodeExporter commented 9 years ago
Follow-on landed at rf1e1c1e43fdd

Original comment by shannonw...@chromium.org on 8 Aug 2013 at 8:09