vo_gpu: explicitly set target_params to NULL on uninit

Prevents vo_get_target_params from segfaulting if called somewhere else
in the code since the underlying p->renderer was just freed.
This commit is contained in:
Dudemanguy 2024-10-26 15:06:33 -05:00
parent 2827c9f323
commit 8039128693
1 changed files with 4 additions and 0 deletions

View File

@ -279,6 +279,10 @@ static void uninit(struct vo *vo)
struct gpu_priv *p = vo->priv; struct gpu_priv *p = vo->priv;
gl_video_uninit(p->renderer); gl_video_uninit(p->renderer);
mp_mutex_lock(&vo->params_mutex);
vo->target_params = NULL;
mp_mutex_unlock(&vo->params_mutex);
if (vo->hwdec_devs) { if (vo->hwdec_devs) {
hwdec_devices_set_loader(vo->hwdec_devs, NULL, NULL); hwdec_devices_set_loader(vo->hwdec_devs, NULL, NULL);
hwdec_devices_destroy(vo->hwdec_devs); hwdec_devices_destroy(vo->hwdec_devs);