Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed bus error when converting 16-bit to float for non-integral-mult…
…iple sample rates
  • Loading branch information
slouken committed Dec 19, 2016
1 parent 366c77a commit b2f6c4c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/audio/SDL_audio.c
Expand Up @@ -1191,8 +1191,10 @@ open_audio_device(const char *devname, int iscapture,
return 0;
}
if (device->convert.needed) {
device->convert.len = (int) (((double) device->spec.size) /
device->convert.len = (int) (((double) device->spec.samples) /
device->convert.len_ratio);
device->convert.len *= SDL_AUDIO_BITSIZE(device->spec.format) / 8;
device->convert.len *= device->spec.channels;

device->convert.buf =
(Uint8 *) SDL_malloc(device->convert.len *
Expand Down

0 comments on commit b2f6c4c

Please sign in to comment.