return error in OnDecodeError when there are oversized UDP packets

This commit is contained in:
aler9
2022-10-31 15:38:23 +01:00
parent 5a5f454814
commit b1f72f9392
8 changed files with 93 additions and 20 deletions

View File

@@ -820,7 +820,7 @@ func (c *Client) runReader() {
}
} else {
if len(payload) > maxPacketSize {
return fmt.Errorf("payload size (%d) greater than maximum allowed (%d)",
return fmt.Errorf("payload size (%d) is greater than maximum allowed (%d)",
len(payload), maxPacketSize)
}
@@ -846,7 +846,7 @@ func (c *Client) runReader() {
processFunc = func(track *clientTrack, isRTP bool, payload []byte) error {
if !isRTP {
if len(payload) > maxPacketSize {
return fmt.Errorf("payload size (%d) greater than maximum allowed (%d)",
return fmt.Errorf("payload size (%d) is greater than maximum allowed (%d)",
len(payload), maxPacketSize)
}