Fix possible pcm_bytes_to_samples overflow

This commit is contained in:
bnnm 2019-02-24 09:52:48 +01:00
parent 397c6e0e81
commit 7372ffdc5c

View File

@ -221,5 +221,5 @@ void decode_pcmfloat(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspac
}
size_t pcm_bytes_to_samples(size_t bytes, int channels, int bits_per_sample) {
return (bytes * 8) / channels / bits_per_sample;
return ((int64_t)bytes * 8) / channels / bits_per_sample;
}