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

Avoid crash in samplebuilder.PopWithTimestamp #1838

Closed
wants to merge 1 commit into from

Conversation

jech
Copy link
Member

@jech jech commented Jun 20, 2021

If sample is null, PopWithTimestamp will crash with SIGSEGV.

goroutine 259 [running]:
github.com/pion/webrtc/v3/pkg/media/samplebuilder.(*SampleBuilder).PopWithTimestamp(...)
        /home/jch/go/pkg/mod/github.com/pion/webrtc/v3@v3.0.29/pkg/media/samplebuilder/samplebuilder.go:285
github.com/jech/galene/diskwriter.(*diskTrack).Write(0xc0003c8000, 0xc00041cc00, 0x35f, 0x5e0, 0x0, 0x0, 0x0)
        /home/jch/go/src/github.com/jech/galene/diskwriter/diskwriter.go:477 +0x27f
github.com/jech/galene/rtpconn.sendKeyframe(0xc0000900c0, 0x3, 0x3, 0xa413d8, 0xc0003c8000, 0xc0000f6000)
        /home/jch/go/src/github.com/jech/galene/rtpconn/rtpwriter.go:218 +0xe9
created by github.com/jech/galene/rtpconn.rtpWriterLoop
        /home/jch/go/src/github.com/jech/galene/rtpconn/rtpwriter.go:263 +0x69b
exit status 2

If sample is null, PopWithTimestamp will crash with SIGSEGV.
@codecov
Copy link

codecov bot commented Jun 20, 2021

Codecov Report

Merging #1838 (6d2e932) into master (41243cd) will decrease coverage by 0.25%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1838      +/-   ##
==========================================
- Coverage   75.57%   75.31%   -0.26%     
==========================================
  Files          84       84              
  Lines        5998     6000       +2     
==========================================
- Hits         4533     4519      -14     
- Misses       1080     1092      +12     
- Partials      385      389       +4     
Flag Coverage Δ
go 76.99% <0.00%> (-0.29%) ⬇️
wasm 71.11% <0.00%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/media/samplebuilder/samplebuilder.go 91.17% <0.00%> (-1.37%) ⬇️
internal/mux/mux.go 82.53% <0.00%> (-7.94%) ⬇️
sctptransport.go 76.11% <0.00%> (-3.34%) ⬇️
dtlstransport.go 63.88% <0.00%> (-1.86%) ⬇️
datachannel.go 82.98% <0.00%> (ø)
peerconnection.go 75.48% <0.00%> (+0.08%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 41243cd...6d2e932. Read the comment docs.

@Sean-Der
Copy link
Member

Merged with 11f6a65

I just added a test, thanks for fixing this @jech !

@Sean-Der Sean-Der closed this Jun 20, 2021
@jech jech deleted the avoid-samplebuilder-crash branch June 20, 2021 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants