mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fixed possible issue with wrong size being passed to opus_decode().
This commit is contained in:
parent
2bb1549bc9
commit
af0d6c0695
|
@ -379,9 +379,8 @@ void cs_do(CSSession *cs)
|
|||
pthread_mutex_unlock(cs->queue_mutex);
|
||||
|
||||
|
||||
uint16_t fsize = (cs->audio_decoder_channels *
|
||||
(cs->audio_decoder_sample_rate * cs->audio_decoder_frame_duration) / 1000);
|
||||
int16_t tmp[fsize];
|
||||
uint16_t fsize = ((cs->audio_decoder_sample_rate * cs->audio_decoder_frame_duration) / 1000);
|
||||
int16_t tmp[fsize * cs->audio_decoder_channels];
|
||||
|
||||
rc = opus_decode(cs->audio_decoder, p->data, p->size, tmp, fsize, (p->size == 0));
|
||||
free(p);
|
||||
|
|
Loading…
Reference in New Issue
Block a user