fix out-of-bounds Xsbr write in hf_assembly sinusoid addition - #224
Merged
fabiangreffrath merged 1 commit intoJun 24, 2026
Merged
Conversation
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.
hf_assembly guards the top-band sinusoid leak with
if (m + sbr->kx < 64)but writes Xsbr[i + tHFAdj][m + sbr->kx + 1], so when a crafted SBR header makes kx + M reach 64 (the largest value derived_frequency_table allows) the m == M-1 step has m + kx of 63, passes the check, and writes one QMF subband past the 64-wide Xsbr row into the next time slot of the history buffer. The faulty write sits in the SBR_LOW_POWER synthesis path and triggers on a crafted HE-AAC stream whose frequency band layout reaches that boundary. Comparing the index that is actually written keeps the leaked top-band energy from landing out of range.