From 0ee6e86638bc92af8209127de46a9c3d0c81c46a Mon Sep 17 00:00:00 2001 From: Saxon Date: Mon, 27 May 2019 14:23:33 +0930 Subject: [PATCH] codec/h264/lex.go: fixed bug in handleFUA --- codec/h264/lex.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/codec/h264/lex.go b/codec/h264/lex.go index b9a58ad2..07c9acc1 100644 --- a/codec/h264/lex.go +++ b/codec/h264/lex.go @@ -266,19 +266,19 @@ func (l *RTPLexer) handleFUA(d []byte) { // If start, form new header, skip FU indicator only and set first byte to // new header. Otherwise, skip over both FU indicator and FU header. if start { + newHead := (d[0] & 0xe0) | (d[1] & 0x1f) + d = d[1:] + d[0] = newHead if end { panic("bad fragmentation packet") } - newHead := (d[0] & 0xe0) | (d[0] & 0x1f) - d = d[1:] - d[0] = newHead l.frag = true l.writeWithPrefix(d) } else { + d = d[2:] if end { l.frag = false } - d = d[2:] l.writeNoPrefix(d) } }