Fixed bug with 16bit sample size

This commit is contained in:
jsalmon3 2003-09-29 21:25:44 +00:00
parent 91f799ded2
commit fb06d9d144

View file

@ -256,7 +256,7 @@ global Sample* LoadWav(const char* name, int flags __attribute__((unused)))
//
// Read sample
//
sample = malloc(sizeof(*sample) + WAV_BUFFER_SIZE*wavfmt.Channels);
sample = malloc(sizeof(*sample) + WAV_BUFFER_SIZE * wavfmt.Channels * wavfmt.SampleSize);
sample->Channels = wavfmt.Channels;
sample->SampleSize = wavfmt.SampleSize * 8 / sample->Channels;
sample->Frequency = wavfmt.Frequency;