mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +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) {
|
switch (timelineType) {
|
||||||
case SLOT_ATTACHMENT: {
|
case SLOT_ATTACHMENT: {
|
||||||
AttachmentTimeline *timeline = new (__FILE__, __LINE__) AttachmentTimeline(frameCount, slotIndex);
|
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);
|
timelines.add(timeline);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user