Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

G722: Fix buffer overflow #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/audiofilters/msg722.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ static void dec_process(MSFilter *f) {
/* introduce delay (TRANSITION_DELAY ms) */
generic_plc_update_continuity_buffer(s->plc_context, om->b_wptr, declen*sizeof(int16_t));

if (s->plc_context->plc_samples_used!=0) {
if (s->plc_context->plc_samples_used!=0 && declen >= 2*16*TRANSITION_DELAY) {
/* we were doing PLC, now resuming with normal audio, continuity buffer is twice the transition delay lengths,
* the second half is untouched by the update function and contains transition data generated by PLC */
generic_plc_transition_mix(((int16_t *)(om->b_wptr))+16*TRANSITION_DELAY, ((int16_t *)(s->plc_context->continuity_buffer))+16*TRANSITION_DELAY, 16*TRANSITION_DELAY);
Expand Down