Skip to content
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

Array out of bounds in sprite_3d.cpp #36115

Closed
qarmin opened this issue Feb 11, 2020 · 4 comments
Closed

Array out of bounds in sprite_3d.cpp #36115

qarmin opened this issue Feb 11, 2020 · 4 comments
Milestone

Comments

@qarmin
Copy link
Contributor

qarmin commented Feb 11, 2020

Godot version:
Godot 4.0 master(vulkan)
OS/device including version:
Ubuntu 19.10
Issue description:
Here is created uvs with only 4 elements

Vector2 uvs[4] = {

but here is readed also element 5 and 6

for (int i = 0; i < 6; i++) {
static const int index[6] = { 0, 1, 2, 0, 2, 3 };
VS::get_singleton()->immediate_normal(immediate, normal);
VS::get_singleton()->immediate_tangent(immediate, tangent);
VS::get_singleton()->immediate_color(immediate, color);
VS::get_singleton()->immediate_uv(immediate, uvs[i]);

also here is same problem

VS::get_singleton()->immediate_uv(immediate, uvs[i]);

@qarmin qarmin added this to the 4.0 milestone Feb 11, 2020
@Calinou
Copy link
Member

Calinou commented Feb 11, 2020

By the way, Sprite3D needs a refactor to avoid using ImmediateGeometry, which is slow and unnecessary for geometry that doesn't change.

@Calinou
Copy link
Member

Calinou commented Jul 6, 2020

If you can build Godot from source, please build the 3.2 branch and test this again now that #39867 has been merged. (That pull request also makes Sprite3D much faster to render.)

You can also use this Windows 64-bit editor binary for testing.

@qarmin
Copy link
Contributor Author

qarmin commented Jul 6, 2020

Out of bounds code was added only in Godot 4.0, so there is no need to test it with 3.2.

https://github.com/godotengine/godot/blame/1eb424ec9549bdd086dfb54c847d107519be73d9/scene/3d/sprite_3d.cpp#L507

@qarmin
Copy link
Contributor Author

qarmin commented Dec 9, 2020

Fixed by #44199

@qarmin qarmin closed this as completed Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants