mirror of https://bitbucket.org/ausocean/av.git
packet.writeTo now defends against a zero pkt.bodySize.
This commit is contained in:
parent
9f3d49faa5
commit
4c6c549f98
|
@ -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.
|
// 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.
|
// 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 {
|
func (pkt *packet) writeTo(s *Session, queue bool) error {
|
||||||
if pkt.body == nil {
|
if pkt.body == nil || pkt.bodySize == 0 {
|
||||||
return errInvalidBody
|
return errInvalidBody
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue