1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

RTAS compatibility fix. Wav file fix for coping with corrupt files.

This commit is contained in:
jules 2012-04-18 17:05:25 +01:00
parent 83fa27c4f2
commit 0826b28983
2 changed files with 9 additions and 3 deletions

View file

@ -85,7 +85,7 @@ namespace WavFileHelpers
uint8 reserved[190];
char codingHistory[1];
void copyTo (StringPairArray& values) const
void copyTo (StringPairArray& values, const int totalSize) const
{
values.set (WavAudioFormat::bwavDescription, String::fromUTF8 (description, 256));
values.set (WavAudioFormat::bwavOriginator, String::fromUTF8 (originator, 32));
@ -98,7 +98,8 @@ namespace WavFileHelpers
const int64 time = (((int64)timeHigh) << 32) + timeLow;
values.set (WavAudioFormat::bwavTimeReference, String (time));
values.set (WavAudioFormat::bwavCodingHistory, String::fromUTF8 (codingHistory));
values.set (WavAudioFormat::bwavCodingHistory,
String::fromUTF8 (codingHistory, totalSize - offsetof (BWAVChunk, codingHistory)));
}
static MemoryBlock createFrom (const StringPairArray& values)
@ -591,7 +592,7 @@ public:
HeapBlock <BWAVChunk> bwav;
bwav.calloc (jmax ((size_t) length + 1, sizeof (BWAVChunk)), 1);
input->read (bwav, (int) length);
bwav->copyTo (metadataValues);
bwav->copyTo (metadataValues, (int) length);
}
else if (chunkType == chunkName ("smpl"))
{

View file

@ -977,7 +977,12 @@ private:
case 5: return ePlugIn_StemFormat_5dot0;
case 6: return ePlugIn_StemFormat_5dot1;
case 7: return ePlugIn_StemFormat_6dot1;
#if PT_VERS_MAJOR >= 9
case 8: return ePlugIn_StemFormat_7dot1DTS
#else
case 8: return ePlugIn_StemFormat_7dot1;
#endif
default: jassertfalse; break; // hmm - not a valid number of chans for RTAS..
}