freeswitch/spandsp

`plc_fillin` can overflow the input buffer

MathieuDuponchelle opened this issue · 6 comments

When calling plc_fillin with plc_state_t *s and s->missing_samples == 0, the function attempts to write pitch_overlap bytes to the input buffer, regardless of its length. This causes crashes in a GStreamer application using the spandsp plugin, because it might call plc_fillin with very small buffers (eg with my test case 2-byte long).

Can the documentation of plc_fillin be updated to specify the minimum size of its input buffers, or even better the function be fixed to support any-sized buffers?

Thanks!

Hi @MathieuDuponchelle
Can you fix that and make a PR?

Hey @andywolk , I wish, but I'm completely unfamiliar with the code base. Perhaps if you guide me through the correct solution I can propose something, but that will probably not be very efficient :)