Skip to content

Commit 8c71e73

Browse files
author
yx.xiong
committed
Reference: 4.2 Spine 3.8 – Return immediately if the default skin fails to load, to prevent subsequent reading from causing a Memory access out of bounds error.
1 parent 4596454 commit 8c71e73

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

native/cocos/editor-support/spine/3.8/spine/SkeletonBinary.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,12 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons
279279
skeletonData->_defaultSkin = defaultSkin;
280280
skeletonData->_skins.add(defaultSkin);
281281
}
282+
283+
if (!this->getError().isEmpty()) {
284+
delete input;
285+
delete skeletonData;
286+
return NULL;
287+
}
282288

283289
/* Skins. */
284290
for (size_t i = 0, n = (size_t)readVarint(input, true); i < n; ++i) {

0 commit comments

Comments
 (0)