engine: client: sound: clamp mixed sample count to requested amount, fixes paintbuffer overflow with timecompressed VOX

This commit is contained in:
Alibek Omarov
2026-08-06 16:14:52 +05:00
parent 15276ef92a
commit 3041bd0ba9
+3
View File
@@ -250,6 +250,9 @@ static int S_MixChannelToBuffer( portable_samplepair_t *pbuf, channel_t *chan, i
out_count = (int)floor(( available - 1 - sample_frac ) / rate );
else
out_count = (int)ceil(( available - sample_frac ) / rate );
if( out_count > num_samples )
out_count = num_samples;
}
// near a buffer boundary (e.g. just before a loop wrap) lerp may yield zero;