Fixed possible issue with wrong size being passed to opus_decode().

This commit is contained in:
irungentoo 2014-12-07 18:23:55 -05:00
parent 2bb1549bc9
commit af0d6c0695
No known key found for this signature in database
GPG Key ID: 10349DC9BED89E98

View File

@ -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);