MT#55283 recording-daemon: add static_assert for payload_type bounds invariant

The bitmask `& 0x7f` on m_pt guarantees values 0-127, and the decoders
array has 128 entries, so out-of-bounds access is structurally impossible.
Add a compile-time static_assert documenting this invariant.

Closes #2107

Change-Id: I9debd6ddf4ac928ded71d2189775e10dee98e0de
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
master
OrbisAI Security 4 days ago committed by Richard Fuchs
parent 4be228b4fb
commit ad6fbef99b

@ -92,6 +92,9 @@ out:
}
static_assert(0x7f < G_N_ELEMENTS(((ssrc_t *)0)->decoders),
"payload_type mask 0x7f must be within decoders array bounds");
// ssrc is locked
static void packet_decode(ssrc_t *ssrc, packet_t *packet) {
// determine payload type and run decoder

Loading…
Cancel
Save