-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix sanitizers reports about octahedral tangents in RenderingServer #78902
Fix sanitizers reports about octahedral tangents in RenderingServer #78902
Conversation
Looks great! Could you update the commit message to be more explicit (e.g. like I did with the PR title)? Would this happen to be this issue? #78749 |
No, that issue is about a free without malloc / memory corruption issue, while the linked CI fail is an index out of bounds access to a vector. |
032f418
to
c022f52
Compare
I fixed the commit message as you requested.)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
For the record, even when the CI step doesn't error out, the following errors are reported which relate to the code here:
This change fixes the last one, but the first three errors about |
Okay, now I'll try to find the causes of the rest of the errors. |
I think I've found the cause of the rest of the errors, but I'm not sure if I substituted the correct values when forming the mesh. Please correct me as I haven't worked much with 3D scenes and coordinates. I found the problem place by setting a breakpoints with a conditions, and then examining the call stack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great!
The defaults in SpriteBase3D just need to be normalized. They won't be used as-is as the values are always overwritten, so moving from 0,0,0 to any normalized vector is fine.
I'm very happy) Does this mean that the current state of the code is valid? |
Yes, as far as I can tell! |
Thanks! |
Cherry-picked for 4.1.1. |
I found three places in RenderingServer with wrong type casting from
float
clamped by range[0..65535]
toint
toint16_t[-32768..32767]
insteaduint16_t[0..65535]
.In rarely situations it leads conversion from big positive number to negative.
In some cases it can break the check Linux / Editor with doubles and GCC sanitizers.