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

DXF export: fix crash on some MultiPolygon geometries when offset != 0 (fixes #46245) #47277

Merged
merged 2 commits into from
Feb 11, 2022

Conversation

rouault
Copy link
Contributor

@rouault rouault commented Feb 9, 2022

No description provided.

@rouault rouault added the backport queued_ltr_backports Queued Backports label Feb 9, 2022
@github-actions github-actions bot added this to the 3.24.0 milestone Feb 9, 2022
Q_ASSERT( polygon );
const QgsGeometryCollection *gc = dynamic_cast<const QgsGeometryCollection *>( sourceGeom );
Q_ASSERT( gc );
if ( gc )
Copy link
Member

Choose a reason for hiding this comment

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

So ... now I'm wondering if we need this check at all, at this point we should be sure we have a gc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

at this point we should be sure we have a gc

I think so, but can't swear :-) The current code should be safe enough: not crashing in production builds, and asserting in debug builds so we can investigate what's going on

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense. I always lived by the rule after an assert ub is allowed in prod. But not sure that's a common understanding 🤪

for ( int i = 0; i < gc->numGeometries(); i++ )
const QgsGeometryCollection *gc = dynamic_cast<const QgsGeometryCollection *>( sourceGeom );
Q_ASSERT( gc );
if ( gc )
Copy link
Member

Choose a reason for hiding this comment

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

Same remark, the if after the assert only makes sense if this is realistic to happen because of some uncontrollable conditions with release builds

Copy link
Member

@m-kuhn m-kuhn left a comment

Choose a reason for hiding this comment

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

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants