--- libgig/trunk/src/DLS.cpp 2004/11/26 19:29:06 316 +++ libgig/trunk/src/DLS.cpp 2004/12/04 14:13:49 317 @@ -414,7 +414,18 @@ WavePoolCount = ptbl->ReadUint32(); pWavePoolTable = new uint32_t[WavePoolCount]; ptbl->SetPos(headersize); - ptbl->Read(pWavePoolTable, WavePoolCount, sizeof(uint32_t)); + + // Check for 64 bit offsets (used in gig v3 files) + if (ptbl->GetSize() - headersize == WavePoolCount * 8) { + for (int i = 0 ; i < WavePoolCount ; i++) { + // Just ignore the upper bits for now + uint32_t upper = ptbl->ReadUint32(); + pWavePoolTable[i] = ptbl->ReadUint32(); + if (upper || (pWavePoolTable[i] & 0x80000000)) + throw DLS::Exception("Files larger than 2 GB not yet supported"); + } + } + else ptbl->Read(pWavePoolTable, WavePoolCount, sizeof(uint32_t)); pSamples = NULL; pInstruments = NULL;