Skip to content

Codec input sanitization#427

Merged
mondain merged 1 commit intoRed5:mainfrom
kdkd:cherry-pick-272502d-20251128-165828
Dec 11, 2025
Merged

Codec input sanitization#427
mondain merged 1 commit intoRed5:mainfrom
kdkd:cherry-pick-272502d-20251128-165828

Conversation

@kdkd
Copy link
Copy Markdown

@kdkd kdkd commented Nov 28, 2025

Commit from kdkd fork 272502d

Codec sanitization

ScreenVideo allocated more memory than necessary per block, and could run past EOF if the block was malformed.

ScreenVideo2 had the same issues as ScreenVideo, but calculated blockHeight and blockWidth incorrectly due to missing ().

ExtendedAudio did not rewind the pointer if it decided it couldn't handle the audio, and could cause an NPE on an unknown or invalid fourcc value.

AV1Video always thought data passed to it was AV1 data rather than checking the fourcc value.

MPEG1Video had the opposite problem, it looked to see if the data was AVC video data then tried to parse it as though it were MPEG1, and threw away the first configuration packet because decoderConfiguration wasn't initialized on the first pass.


ScreenVideo allocated more memory than necessary per block, and could run past EOF if the block was malformed.

ScreenVideo2 had the same issues as ScreenVideo, but calculated blockHeight and blockWidth incorrectly due to missing ().

ExtendedAudio did not rewind the pointer if it decided it couldn't handle the audio, and could cause an NPE on an unknown or invalid fourcc value.

AV1Video always thought data passed to it was AV1 data rather than checking the fourcc value.

MPEG1Video had the opposite problem, it looked to see if the data was AVC video data then tried to parse it as though it were MPEG1, and threw away the first configuration packet because decoderConfiguration wasn't initialized on the first pass.
@mondain mondain merged commit 97339c3 into Red5:main Dec 11, 2025
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