diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-09-18 17:13:35 +0300 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-09-18 17:13:35 +0300 |
commit | 56088ff4dc5180e95ea0c60f86a4b5ffc5c76611 (patch) | |
tree | f2882194201e5997fa76fc97f2eae136833f0573 /libmpcodecs | |
parent | 350fc4f5a2f6f4fdf9cc689d786d525f6397df5d (diff) | |
download | mpv-56088ff4dc5180e95ea0c60f86a4b5ffc5c76611.tar.bz2 mpv-56088ff4dc5180e95ea0c60f86a4b5ffc5c76611.tar.xz |
vo_vdpau: Fix memory corruption bug with MP_IMGTYPE_NUMBERED
The way vo_vdpau kept references to vf mpi objects was unsafe; with
fixed-vo enabled the vf object could be destroyed and a new one
created, but vo_vdpau would still keep the now stale references and
modify memory through them to adjust usage counts. Send a VOCTRL_RESET
from vf_vo uninit() to allow vo_vdpau to erase such references.
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/vf_vo.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libmpcodecs/vf_vo.c b/libmpcodecs/vf_vo.c index 53dc8267b6..c782a5517b 100644 --- a/libmpcodecs/vf_vo.c +++ b/libmpcodecs/vf_vo.c @@ -203,6 +203,9 @@ static void draw_slice(struct vf_instance* vf, static void uninit(struct vf_instance* vf) { if (vf->priv) { + /* Allow VO (which may live on to work with another instance of vf_vo) + * to get rid of numbered-mpi references that will now be invalid. */ + vo_control(video_out, VOCTRL_RESET, NULL); #ifdef CONFIG_ASS if (vf->priv->ass_priv) ass_renderer_done(vf->priv->ass_priv); |