KikoPlayProject / KikoPlay

KikoPlay - NOT ONLY A Full-Featured Danmu Player 不仅仅是全功能弹幕播放器
https://kikoplay.fun
GNU General Public License v3.0
1.63k stars 96 forks source link

Fix potential bugs about `MPVPlayer::handle_mpv_event` #107

Closed Chaojimengnan closed 1 year ago

Chaojimengnan commented 1 year ago

https://github.com/KikoPlayProject/KikoPlay/blob/0afa45e901f33f7ac42d1bdb0c9c246d414c535d/Play/Video/mpvplayer.cpp#L789-L795

The lambda in the propertyFunc will only capture the event when the propertyFunc is first initialized, which results in undefined behavior. Passing event as an argument to lambda will fix this bug.

Protostars commented 1 year ago

确实是潜在的问题,不过似乎libmpv不会为mpv_event重新分配内存,也就表现正常