-
Notifications
You must be signed in to change notification settings - Fork 137
Fix crashing on an empty MeshGL with one runIndex element #1261
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1261 +/- ##
==========================================
+ Coverage 92.18% 92.20% +0.01%
==========================================
Files 31 31
Lines 5896 5898 +2
==========================================
+ Hits 5435 5438 +3
+ Misses 461 460 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Thanks. Will have a look later today. |
An empty MeshGL with one runIndex is now valid and no longer crashes. I'm not sure about test naming though. |
Seems fine to me. Btw, I'm thinking if we should do more input validation, i.e., to make sure the indices are correct and don't segfault when they are incorrect. |
I agree. It may be better to make another PR instead of this one If possible, I'll investigate more types of exotic input later to see if any of them cause crashes or segfaults. |
Sounds good, I will let @elalish decide for the tests. I don't have a strong opinion about this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thanks!
Fixes #1260
runIndex == 1
to prevent out-of-bounds access; otherwise, it failed and raisedRunIndexWrongLength
.runIndex
Anyway, I just read the description of
runIndex
. It appears that its length can be equal to the size ofrunOriginalID
orrunOriginalID + 1
. Therefore, an emptyrunOriginalID
(length = 0) followed by a single elementrunIndex
may actually be valid. Given this, I think it shouldn't drop the errorRunIndexWrongLength
and let the input pass. (like my workaround)Any ideas ?
CC @elalish