mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 22:34:53 +08:00
[cpp] Fix UB in attachment timeline binary parsing
This commit is contained in:
parent
75420e196a
commit
3e67c82a22
@ -805,7 +805,11 @@ Animation *SkeletonBinary::readAnimation(DataInput &input, const String &name, S
|
||||
switch (timelineType) {
|
||||
case SLOT_ATTACHMENT: {
|
||||
AttachmentTimeline *timeline = new (__FILE__, __LINE__) AttachmentTimeline(frameCount, slotIndex);
|
||||
for (int frame = 0; frame < frameCount; ++frame) timeline->setFrame(frame, input.readFloat(), input.readStringRef());
|
||||
for (int frame = 0; frame < frameCount; ++frame) {
|
||||
float time = input.readFloat();
|
||||
char *attachmentName = input.readStringRef();
|
||||
timeline->setFrame(frame, time, attachmentName);
|
||||
}
|
||||
timelines.add(timeline);
|
||||
break;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user