Open
Conversation
…ls to load, to prevent subsequent reading from causing a Memory access out of bounds error.
Comment on lines
+283
to
+287
| if (!this->getError().isEmpty()) { | ||
| delete input; | ||
| delete skeletonData; | ||
| return NULL; | ||
| } |
There was a problem hiding this comment.
Mixed indentation (tabs vs. spaces)
The inner lines of this new block use hard tabs (\t) for indentation, while the rest of the file uses spaces. This is inconsistent with the surrounding code pattern (e.g., lines 278–281, 294–298) and will appear misaligned in editors configured for space-based indentation.
Suggested change
| if (!this->getError().isEmpty()) { | |
| delete input; | |
| delete skeletonData; | |
| return NULL; | |
| } | |
| if (!getError().isEmpty()) { | |
| delete input; | |
| delete skeletonData; | |
| return NULL; | |
| } |
Note: The suggestion also removes the unnecessary this-> qualifier on getError(), which aligns with the simpler style in similar code elsewhere in the function.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re: #
Changelog
Continuous Integration
This pull request:
Compatibility Check
This pull request:
Greptile Summary
This PR improves error handling in Spine 3.8's
SkeletonBinaryby adding two related safety checks: (1) callingsetError()whennewRegionAttachmentreturnsNULLinreadAttachment(line 520), and (2) adding an early-return guard after the default skin is read (lines 283–287) so that a failed region attachment causesreadSkeletonDatato cleanly release resources and returnNULLinstead of silently continuing with a broken skeleton.The
setErrorcall follows the existing pattern already applied toMeshAttachmentfailure (line 556), ensuring callers can retrieve meaningful error information viagetError(). The early-return guard is correctly positioned between default-skin and non-default-skin reading, preventing continued binary parsing after a fatal attachment-load failure.The only remaining issue is mixed indentation in the new guard block (lines 283–287): the body uses hard tabs while the rest of the file uses spaces, causing visual misalignment.
Confidence Score: 4/5
Last reviewed commit: 8c71e73