Don't allow invalid sample format
@@ -91,6 +91,7 @@ static uint32_t lovrSoundDataReadRing(SoundData* soundData, uint32_t offset, uin
SoundData* lovrSoundDataCreateRaw(uint32_t frameCount, uint32_t channelCount, uint32_t sampleRate, SampleFormat format, struct Blob* blob) {
+ lovrAssert(format != SAMPLE_INVALID, "Invalid format");
SoundData* soundData = lovrAlloc(SoundData);
soundData->format = format;
soundData->sampleRate = sampleRate;
@@ -112,6 +113,7 @@ SoundData* lovrSoundDataCreateRaw(uint32_t frameCount, uint32_t channelCount, ui
}
SoundData* lovrSoundDataCreateStream(uint32_t bufferSizeInFrames, uint32_t channels, uint32_t sampleRate, SampleFormat format) {
+ lovrAssert(format != SAMPLE_INVALID, "Invalid format");
SoundData* soundData = lovrAlloc(SoundData);
soundData->format = format;
soundData->sampleRate = sampleRate;
