Throw an error instead of crashing if user attempts to load audio with bitdepth >16bits/sample. Updates #996.

Originally committed to SVN as r3545.
This commit is contained in:
Karl Blomster 2009-09-21 01:52:34 +00:00
parent 3edb446bec
commit fcd8f4e04e
1 changed files with 4 additions and 0 deletions

View File

@ -232,6 +232,10 @@ AudioProvider *CreateConvertAudioProvider(AudioProvider *source_provider) {
provider->GetSampleRate() < 32000 ||
!provider->AreSamplesNativeEndian())
{
// @todo add support for more bitdepths (i.e. 24- and 32-bit audio)
if (provider->GetBytesPerSample() > 2)
throw _T("Audio format converter: audio with bitdepths greater than 16 bits/sample is currently unsupported");
provider = new ConvertAudioProvider(provider);
}