Skip to content

chore: use BLOCK_LEN_LONG consistently in filterbank buffer copies#104

Merged
fabiangreffrath merged 1 commit into
knik0:masterfrom
orbisai0security:fix-filtbank-memcpy-bounds-v001
May 16, 2026
Merged

chore: use BLOCK_LEN_LONG consistently in filterbank buffer copies#104
fabiangreffrath merged 1 commit into
knik0:masterfrom
orbisai0security:fix-filtbank-memcpy-bounds-v001

Conversation

@orbisai0security
Copy link
Copy Markdown
Contributor

@orbisai0security orbisai0security commented May 15, 2026

Summary

This is a small consistency cleanup in libfaac/filtbank.c.

FRAME_LEN and BLOCK_LEN_LONG currently evaluate to the same value, so this does not change runtime behavior. The intent is only to make the copy sizes match the surrounding long-block buffer layout, where transf_buf is sized as 2 * BLOCK_LEN_LONG and subsequent processing indexes by BLOCK_LEN_LONG.

This should not be treated as a security fix.

Changes

  • libfaac/filtbank.c

Verification

  • Build passes
  • Scanner re-scan confirms fix
  • LLM code review passed

Automated security fix by OrbisAI Security

Automated security fix generated by Orbis Security AI
@fabiangreffrath
Copy link
Copy Markdown
Collaborator

Both FRAME_LEN and BLOCK_LEN_LONG evaluate to 1024, right?

@orbisai0security
Copy link
Copy Markdown
Contributor Author

Thanks, yes, you’re right that FRAME_LEN and BLOCK_LEN_LONG currently evaluate to the same value here, so this change does not materially change the generated copy size.

On closer review, I agree the original “critical heap corruption” framing is too strong: the code appears to use fixed AAC frame/block constants, and I don’t have evidence that these sizes are attacker-controlled in this path.

The only possible rationale for the change would be readability/consistency: transf_buf is sized as 2 * BLOCK_LEN_LONG, and the later MDCT/windowing logic is expressed in terms of BLOCK_LEN_LONG, so using BLOCK_LEN_LONG here may make the buffer layout more explicit. But I agree this should not be presented as a security vulnerability fix.

I’ll retitle this as a small readability/consistency cleanup.

@orbisai0security orbisai0security changed the title fix: multiple memcpy calls in the audio filter bank ... in filtbank.c chore: use BLOCK_LEN_LONG consistently in filterbank buffer copies May 16, 2026
@fabiangreffrath
Copy link
Copy Markdown
Collaborator

Thanks!

@fabiangreffrath fabiangreffrath merged commit 9051425 into knik0:master May 16, 2026
6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants