diff options
author | Roland Scheidegger <[email protected]> | 2018-04-24 18:25:55 +0200 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2018-04-25 04:50:20 +0200 |
commit | 77554d220d6d74b4d913dc37ea3a874e9dc550e4 (patch) | |
tree | 666d29fff71276128872350849a2f6a152bbbd6f /src/hgl | |
parent | 98578df27bbf682f254d59a3a7d63b5f1b98f838 (diff) |
draw: fix different sign logic when clipping
The logic was flawed, since mul(x,y) will be <= 0 (exactly 0) when
the sign is the same but both numbers are sufficiently small
(if the product is smaller than 2^-128).
This could apparently lead to emitting a sufficient amount of
additional bogus vertices to overflow the allocated array for them,
hitting an assertion (still safe with release builds since we just
aborted clipping after the assertion in this case - I'm however unsure
if this is now really no longer possible, so that code stays).
Not sure if the additional vertices could cause other grief, I didn't
see anything wrong even when hitting the assertion.
Essentially, both +-0 are treated as positive (the vertex is considered
to be inside the clip volume for this plane), so integrate the logic
determining different sign into the branch there.
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/hgl')
0 files changed, 0 insertions, 0 deletions