From 7372ffdc5c27c39adac007cddafc637b61184c0a Mon Sep 17 00:00:00 2001 From: bnnm Date: Sun, 24 Feb 2019 09:52:48 +0100 Subject: [PATCH] Fix possible pcm_bytes_to_samples overflow --- src/coding/pcm_decoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coding/pcm_decoder.c b/src/coding/pcm_decoder.c index 93cc1a6e..2427aa24 100644 --- a/src/coding/pcm_decoder.c +++ b/src/coding/pcm_decoder.c @@ -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; }