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

Fix unnecessary repetitions in the crowd #686

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ikpil
Copy link

@ikpil ikpil commented Jan 23, 2024

Maximum values should be checked after post-processing, as unnecessary repetitions may occur.

@@ -163,9 +163,9 @@ int dtProximityGrid::queryItems(const float minx, const float miny,
// Item not found, add it.
if (i == end)
{
ids[n++] = item.id;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If maxIds is initially 0 and ids has 0 size (i.e. points to invalid memory) or nullptr this will lead to a crash due to nullptr dereference or out of bounds access.

@ikpil ikpil force-pushed the pr/avoid-unnecessary-repetitions branch 2 times, most recently from af2d04e to 8f8cc01 Compare January 29, 2024 16:38
Maximum values should be checked after post-processing, as unnecessary repetitions may occur.
@ikpil ikpil force-pushed the pr/avoid-unnecessary-repetitions branch from 5376ca0 to 83e779e Compare April 16, 2024 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants