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

plc_fillin can overflow the input buffer #43

Open
MathieuDuponchelle opened this issue Jul 1, 2022 · 6 comments
Open

plc_fillin can overflow the input buffer #43

MathieuDuponchelle opened this issue Jul 1, 2022 · 6 comments

Comments

@MathieuDuponchelle
Copy link

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!

@andywolk
Copy link
Member

andywolk commented Jul 2, 2022

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

@MathieuDuponchelle
Copy link
Author

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 :)

coppice-git added a commit that referenced this issue Jun 16, 2023
@coppice-git
Copy link
Collaborator

That problem should now be fixed. There was a test in the normal receive function that was missing in the fillin version.

@andywolk
Copy link
Member

@coppice-git shouldn't the file sit in src/ not in root?

@coppice-git
Copy link
Collaborator

coppice-git commented Jun 16, 2023

Yeah. I just screwed up, while trying to sort out my access to the repo. It should be fixed now.

coppice-git added a commit that referenced this issue Jun 16, 2023
…ure a number

of samples > "len" is never returned is missing from plc_fillin.
@MathieuDuponchelle
Copy link
Author

Great, thanks! To be honest though I don't remember how I was testing this so can't confirm the fix works :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants