Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

size 20 < 20: RTP header size insufficient for extension #275

Open
danvirsen opened this issue Jul 10, 2024 · 0 comments
Open

size 20 < 20: RTP header size insufficient for extension #275

danvirsen opened this issue Jul 10, 2024 · 0 comments

Comments

@danvirsen
Copy link

danvirsen commented Jul 10, 2024

Your environment.

  • Version: v1.8.6
  • Browser: N/A
  • Other Information

The following test use a packet that was previously unmarshalled without issue:

func TestKeepAlivePacket(t *testing.T) {
	rawPkt := []byte{
		0x10, 0x64, 0x57, 0x49, 0x0, 0x0, 0x1, 0x90, 0x12, 0x34, 0xAB, 0xCD,
		0xBE, 0xDE, 0x0, 0x1, 0x2, 0xDA, 0x58, 0x43,
	}

	p := &Packet{}
	if err := p.Unmarshal(rawPkt); err != nil {
		t.Fatal(err)
	}
}

The change that causes the error was made in this commit: 7dc2af5 (v1.8.3?).

Looking at packet.go:190, the error message doesn't match the if statement. If I change the if statement to match the error message (len(buf) < extensionPayloadEnd) then everything works again.

The problem is that I'm not sure entirely sure it should work. From what I can tell, our keep-alive packet follows the specification but this is fairly new territory for me so I am less than confident. From my perspective this looks like a bug in pion/rtp, but maybe our packet is simply wrong.

What did you do?

I upgraded pion/rtp from v1.7.4 to v1.8.6 and ran our unit tests.

What did you expect?

I expected the unmarshal to work as in previous versions of the rtp package.

What happened?

The unmarshal failed with the following confusing error message:

size 20 < 20: RTP header size insufficient for extension
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant