From 18e9eebb8d1a68032bbb6a8cb2a0501097255378 Mon Sep 17 00:00:00 2001 From: parax0 Date: Fri, 29 Apr 2016 23:17:52 -0600 Subject: [PATCH] Fixed crash when loading uncompressed MP2 animations --- src/Core/Resource/Factory/CAnimationLoader.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Core/Resource/Factory/CAnimationLoader.cpp b/src/Core/Resource/Factory/CAnimationLoader.cpp index 6f9396df..c22618ef 100644 --- a/src/Core/Resource/Factory/CAnimationLoader.cpp +++ b/src/Core/Resource/Factory/CAnimationLoader.cpp @@ -1,4 +1,5 @@ #include "CAnimationLoader.h" +#include #include #include @@ -63,6 +64,7 @@ void CAnimationLoader::ReadUncompressedANIM() // Bone channel list u32 NumBoneIndices = mpInput->ReadLong(); + ASSERT(NumBoneIndices == 100); std::vector BoneIndices(NumBoneIndices); for (u32 iChan = 0; iChan < NumBoneIndices; iChan++) @@ -132,7 +134,7 @@ void CAnimationLoader::ReadUncompressedANIM() ScaleIndices[iScale] = mpInput->ReadByte(); if (ScaleIndices[iScale] != 0xFF) - NumScaleIndices++; + NumScaleChannels++; } }