pion / mediadevices

Go implementation of the MediaDevices API.
https://pion.ly/
MIT License
530 stars 121 forks source link

Allow double close of codecs #364

Closed at-wat closed 2 years ago

at-wat commented 2 years ago

Video/AudioTrack.NewRTPReader() internally closes encoder on error. It caused double free if user closes reader after error.

codecov[bot] commented 2 years ago

Codecov Report

Merging #364 (b84cced) into master (1f313a9) will increase coverage by 0.11%. The diff coverage is 60.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #364      +/-   ##
==========================================
+ Coverage   46.30%   46.41%   +0.11%     
==========================================
  Files          67       67              
  Lines        4354     4369      +15     
==========================================
+ Hits         2016     2028      +12     
- Misses       2214     2218       +4     
+ Partials      124      123       -1     
Impacted Files Coverage Δ
pkg/codec/vaapi/vp8.go 0.00% <0.00%> (ø)
pkg/codec/vaapi/vp9.go 0.00% <0.00%> (ø)
pkg/codec/openh264/openh264.go 72.41% <100.00%> (+1.50%) :arrow_up:
pkg/codec/opus/opus.go 62.79% <100.00%> (+1.34%) :arrow_up:
pkg/codec/vpx/vpx.go 81.91% <100.00%> (+0.29%) :arrow_up:
pkg/codec/x264/x264.go 64.70% <0.00%> (+3.52%) :arrow_up:

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 1f313a9...b84cced. Read the comment docs.