audio: dcblock: reject mismatched source/sink frame formats in prepare - #11078
Closed
piotrhoppeintel with Copilot wants to merge 2 commits into
Closed
audio: dcblock: reject mismatched source/sink frame formats in prepare#11078piotrhoppeintel with Copilot wants to merge 2 commits into
piotrhoppeintel with Copilot wants to merge 2 commits into
Conversation
Collaborator
|
Can one of the admins verify this patch?
|
Add a check in dcblock_prepare() that rejects pipelines where the sink frame format does not match the source frame format. Without this check, the processing kernel would interpret the sink buffer using the source sample type/width and corrupt output. Signed-off-by: Copilot <copilot@github.com> Co-authored-by: piotrhoppeintel <93944786+piotrhoppeintel@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix the code for review comment
audio: dcblock: reject mismatched source/sink frame formats in prepare
Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dcblock_prepare()selected the processing function solely fromcd->source_formatwithout verifying the sink format matches. A mismatched pipeline would silently proceed and corrupt output by interpreting the sink buffer with the wrong sample type/width.Change
src/audio/dcblock/dcblock.c: Add an explicit format equality check indcblock_prepare()after both formats are fetched; return-EINVALif they differ.This follows the same defensive pattern used for channel-count validation in the same function.