From 0ae6721ee24f9252368fca68a610d73f80e551dd Mon Sep 17 00:00:00 2001 From: zarazaex69 Date: Sat, 9 May 2026 22:22:34 +0300 Subject: [PATCH] fix: panic in seichannel --- internal/muxconn/conn.go | 2 ++ internal/transport/seichannel/h264.go | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/muxconn/conn.go b/internal/muxconn/conn.go index c5d6088..bbcbb9c 100644 --- a/internal/muxconn/conn.go +++ b/internal/muxconn/conn.go @@ -25,6 +25,7 @@ import ( "github.com/openlibrecommunity/olcrtc/internal/crypto" "github.com/openlibrecommunity/olcrtc/internal/link" + "github.com/openlibrecommunity/olcrtc/internal/logger" ) // ErrClosed is returned from Read/Write after the conn has been closed. @@ -53,6 +54,7 @@ func New(ln link.Link, cipher *crypto.Cipher) *Conn { func (c *Conn) Push(ciphertext []byte) { pt, err := c.cipher.Decrypt(ciphertext) if err != nil { + logger.Debugf("muxconn: decrypt failed, dropping frame: %v", err) return } c.mu.Lock() diff --git a/internal/transport/seichannel/h264.go b/internal/transport/seichannel/h264.go index 200a839..01158dd 100644 --- a/internal/transport/seichannel/h264.go +++ b/internal/transport/seichannel/h264.go @@ -190,7 +190,8 @@ func unescapeRBSP(rbsp []byte) []byte { func mustDecodeHex(value string) []byte { data, err := hex.DecodeString(value) if err != nil { - panic(err) + // Hardcoded constants — if this fires the binary is corrupt. + panic(fmt.Sprintf("mustDecodeHex: invalid hardcoded constant %q: %v", value, err)) } return data }