Crash fix for MP3 resource indexing

This commit is contained in:
Jack Andersen 2015-09-23 17:10:59 -10:00
parent 64e38fbc38
commit d6ce7559b9
1 changed files with 3 additions and 0 deletions

View File

@ -332,9 +332,12 @@ bool MREA::ExtractLayerDeps(PAKEntryReadStream& rs, PAKBridge::Level::Area& area
DEPS deps; DEPS deps;
deps.read(drs); deps.read(drs);
printf("%d\n", deps.depLayerCount);
unsigned r=0; unsigned r=0;
for (unsigned l=1 ; l<deps.depLayerCount ; ++l) for (unsigned l=1 ; l<deps.depLayerCount ; ++l)
{ {
if (l > areaOut.layers.size())
break;
PAKBridge::Level::Area::Layer& layer = areaOut.layers.at(l-1); PAKBridge::Level::Area::Layer& layer = areaOut.layers.at(l-1);
layer.resources.reserve(deps.depLayers[l] - r); layer.resources.reserve(deps.depLayers[l] - r);
for (; r<deps.depLayers[l] ; ++r) for (; r<deps.depLayers[l] ; ++r)