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 crash when loading more than 16 vector layers #51782

Merged
merged 1 commit into from
Feb 13, 2023

Conversation

uclaros
Copy link
Contributor

@uclaros uclaros commented Feb 9, 2023

Description

This fixes another unreported regression introduced by #50381. QGIS would crash when trying to load more than 16 vector layers at once.

This was caused by an ambiguous sorting rule passed to std::sort() for sorting vector layers based on their geometry type, which would cause the sorting algorithm to try to read past the list's last element.
Sorting 16 or less layers would not crash as std::sort() uses a different sorting algorithm for small lists.

Also, fixes proper ordering for multipolygons/multisurface/curvepolygons:
Before:
image

After:
image

Kudos to @wonder-sk for tracking this down!

@uclaros uclaros added Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption labels Feb 9, 2023
@github-actions github-actions bot added this to the 3.30.0 milestone Feb 9, 2023
@nyalldawson nyalldawson merged commit ce94020 into qgis:master Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants