From 4c6c549f989a67ff4e4c9caae917f311af6b5262 Mon Sep 17 00:00:00 2001 From: scruzin Date: Sun, 13 Jan 2019 14:28:24 +1030 Subject: [PATCH] packet.writeTo now defends against a zero pkt.bodySize. --- rtmp/packet.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtmp/packet.go b/rtmp/packet.go index 3c2c5d09..138dd917 100644 --- a/rtmp/packet.go +++ b/rtmp/packet.go @@ -272,7 +272,7 @@ func (pkt *packet) resize(size uint32, ht uint8) { // We defer sending small audio packets and combine consecutive small audio packets where possible to reduce I/O. // When queue is true, we expect a response to this request and cache the method on s.methodCalls. func (pkt *packet) writeTo(s *Session, queue bool) error { - if pkt.body == nil { + if pkt.body == nil || pkt.bodySize == 0 { return errInvalidBody }