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

Panic on SampleBuilder.Pop #2955

Open
tubzby opened this issue Nov 21, 2024 · 0 comments
Open

Panic on SampleBuilder.Pop #2955

tubzby opened this issue Nov 21, 2024 · 0 comments

Comments

@tubzby
Copy link

tubzby commented Nov 21, 2024

Your environment.

  • Version: v3.2.40
  • Browser: NA
  • Other Information - stacktraces, related issues, suggestions how to fix, links for us to have context
 panic: runtime error: invalid memory address or nil pointer dereference
 [signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x998b5f]
 goroutine 2219639 [running]:
 github.com/pion/webrtc/v3/pkg/media/samplebuilder.(*SampleBuilder).buildSample(0xc00dec2000, 0x0)
         /go/pkg/mod/github.com/pion/webrtc/[email protected]/pkg/media/samplebuilder/samplebuilder.go:261 +0x41f
 github.com/pion/webrtc/v3/pkg/media/samplebuilder.(*SampleBuilder).Pop(0xc00dec2000)
         /go/pkg/mod/github.com/pion/webrtc/[email protected]/pkg/media/samplebuilder/samplebuilder.go:295 +0x1a
 gdcx.com/ionrecorder/demuxer.(*rtpDemuxer).demuxVideo(0xc001ed6600, 0x5b4?)
         /usr/src/myapp/demuxer/rtpdemuxer.go:73 +0x7a
 gdcx.com/ionrecorder/demuxer.(*rtpDemuxer).Demux(0xc0005b62f8?, 0x400?)
         /usr/src/myapp/demuxer/rtpdemuxer.go:62 +0x4f
 gdcx.com/ionrecorder/ion.(*Transport).onRTP(0xc0005b62a0, 0xc000808240)
         /usr/src/myapp/ion/transport.go:182 +0x62
 gdcx.com/ionrecorder/ion.newTransport.func4(0xc00afef0e0, 0xc000626960?)
         /usr/src/myapp/ion/transport.go:127 +0x4a
 created by github.com/pion/webrtc/v3.(*PeerConnection).onTrack in goroutine 2219597
         /go/pkg/mod/github.com/pion/webrtc/[email protected]/peerconnection.go:469 +0x165

What did you do?

I have a program working as a mp4 recorder for WebRTC streams, what I do is as following:

r, _, err := track.ReadRTP()

// handle err

sampleBuilder.Push(r)

for {
   // crash on this line
    out := sampleBuilder.Pop()
    if out == nil {
         break
    }
}

What did you expect?

Working normally.

What happened?

The program crashed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant