Skip to content

Added check for empty bboxes in count_bboxes_overlapping_bbox #5245

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

Closed
wants to merge 1 commit into from

Conversation

cimarronm
Copy link
Contributor

Another proposed fix for issue #5185

@@ -752,6 +752,10 @@ int count_bboxes_overlapping_bbox(agg::rect_d &a, BBoxArray &bboxes)
agg::rect_d b;
int count = 0;

// If bboxes is empty return zero
if (bboxes.dim(0) == 0 || bboxes.dim(1) == 0 || bboxes.dim(2) == 0)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe say: bboxes.dim(1) != 2 || bboxes.dim(2) != 2? We are bound to have other issues if its mishapen in some other way. Though having a zero anywhere in the shape doesn't indicate a bug elsewhere, having anything other than 2 in the final two dimensions does, so maybe we need to turn that case into an exception.

@mdboom
Copy link
Member

mdboom commented Oct 14, 2015

I'm not opposed to this, and it does fix the bug. However, I'd still like to find something that plugs this hole everywhere, not just in one place. That may mean just grepping for all uses of size and writing these sort of more careful and specific checks everywhere, though.

@cimarronm
Copy link
Contributor Author

@mdboom, that makes sense to me. Maybe I'll let you tackle that and we hold off on this PR in favor of a more general fix.

@tacaswell tacaswell added this to the next point release (1.5.0) milestone Oct 14, 2015
@cimarronm cimarronm closed this Oct 18, 2015
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.

3 participants