Bladeren bron

[cpp] 4.0 porting, fix SkeletonBinary.

badlogic 4 jaren geleden
bovenliggende
commit
1a928d9c65
1 gewijzigde bestanden met toevoegingen van 3 en 2 verwijderingen
  1. 3 2
      spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp

+ 3 - 2
spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp

@@ -105,7 +105,7 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons
 
 	skeletonData = new(__FILE__, __LINE__) SkeletonData();
 
-	char buffer[8] = { 0 };
+	char buffer[16] = { 0 };
 	int lowHash = readInt(input);
 	int hightHash = readInt(input);
 	String hashString;
@@ -745,8 +745,9 @@ Animation *SkeletonBinary::readAnimation(const String &name, DataInput *input, S
 	Vector<Timeline *> timelines;
 	float scale = _scale;
     int numTimelines = readVarint(input, true);
+    SP_UNUSED(numTimelines);
 	// Slot timelines.
-	for (int i = 0, n = numTimelines; i < n; ++i) {
+	for (int i = 0, n = readVarint(input, true); i < n; ++i) {
 		int slotIndex = readVarint(input, true);
 		for (int ii = 0, nn = readVarint(input, true); ii < nn; ++ii) {
 			unsigned char timelineType = readByte(input);