mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-02-06 14:44:25 +01:00
Fix possible pcm_bytes_to_samples overflow
This commit is contained in:
parent
397c6e0e81
commit
7372ffdc5c
@ -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) {
|
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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user