diff options
author | irungentoo <irungentoo@gmail.com> | 2014-12-07 18:23:55 -0500 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2014-12-07 18:23:55 -0500 |
commit | af0d6c0695e3c459989b911b6fb62ce40058440e (patch) | |
tree | 0a7b35bf7b196fdfae6e98a1c7bb5257910a0292 /toxav/codec.c | |
parent | 2bb1549bc97267ba6c00f6907ba16ea4d78aad4e (diff) |
Fixed possible issue with wrong size being passed to opus_decode().
Diffstat (limited to 'toxav/codec.c')
-rw-r--r-- | toxav/codec.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/toxav/codec.c b/toxav/codec.c index eb770f39..baaad47a 100644 --- a/toxav/codec.c +++ b/toxav/codec.c | |||
@@ -379,9 +379,8 @@ void cs_do(CSSession *cs) | |||
379 | pthread_mutex_unlock(cs->queue_mutex); | 379 | pthread_mutex_unlock(cs->queue_mutex); |
380 | 380 | ||
381 | 381 | ||
382 | uint16_t fsize = (cs->audio_decoder_channels * | 382 | uint16_t fsize = ((cs->audio_decoder_sample_rate * cs->audio_decoder_frame_duration) / 1000); |
383 | (cs->audio_decoder_sample_rate * cs->audio_decoder_frame_duration) / 1000); | 383 | int16_t tmp[fsize * cs->audio_decoder_channels]; |
384 | int16_t tmp[fsize]; | ||
385 | 384 | ||
386 | rc = opus_decode(cs->audio_decoder, p->data, p->size, tmp, fsize, (p->size == 0)); | 385 | rc = opus_decode(cs->audio_decoder, p->data, p->size, tmp, fsize, (p->size == 0)); |
387 | free(p); | 386 | free(p); |