diff --git a/rtmp/packet.go b/rtmp/packet.go index 642e6194..0f3ae241 100644 --- a/rtmp/packet.go +++ b/rtmp/packet.go @@ -203,12 +203,11 @@ func (pkt *packet) readFrom(c *Conn) error { pkt.resize(pkt.bodySize, (hbuf[0]&0xc0)>>6) } - sz := c.inChunkSize - if pkt.bodySize < sz { - sz = pkt.bodySize + if pkt.bodySize > c.inChunkSize { + c.log(WarnLevel, pkg+"reading large packet", "size", int(pkt.bodySize)) } - _, err = c.read(pkt.body[:sz]) + _, err = c.read(pkt.body[:pkt.bodySize]) if err != nil { c.log(DebugLevel, pkg+"failed to read packet body", "error", err.Error()) return err