diff options
author | wm4 <wm4@nowhere> | 2018-01-27 00:31:14 +0100 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2018-01-27 03:31:53 -0800 |
commit | 3c1566e736079c968537fe7af0e1e5bbfcd80ec1 (patch) | |
tree | 425a67b3049433f82a1e9e0643d6e3098b387cc1 /video | |
parent | 20cc22437eeaf378ed6e983cd662edc82c6843c6 (diff) |
video: fix crash with vdpau when reinitializing rendering
Using vdpau will allocate additional textures for the reinterleaving
step, which uninit_rendering() will free. This is a problem because the
hwdec image remains mapped when reinitializing, so the reinterleaving
textures are turned into dangling pointers. Fix this by freeing the
reinterleave textures on full uninit instead.
Fixes #5447.
Diffstat (limited to 'video')
-rw-r--r-- | video/out/gpu/video.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c index 727ae8254a..5b8191d16b 100644 --- a/video/out/gpu/video.c +++ b/video/out/gpu/video.c @@ -529,9 +529,6 @@ static void uninit_rendering(struct gl_video *p) for (int n = 0; n < p->num_hook_textures; n++) ra_tex_free(p->ra, &p->hook_textures[n]); - for (int n = 0; n < 2; n++) - ra_tex_free(p->ra, &p->vdpau_deinterleave_tex[n]); - gl_video_reset_surfaces(p); gl_video_reset_hooks(p); @@ -1001,6 +998,9 @@ static void uninit_video(struct gl_video *p) p->hwdec_active = false; p->hwdec_overlay = NULL; ra_hwdec_mapper_free(&p->hwdec_mapper); + + for (int n = 0; n < 2; n++) + ra_tex_free(p->ra, &p->vdpau_deinterleave_tex[n]); } static void pass_record(struct gl_video *p, struct mp_pass_perf perf) |