summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlessandro Ghedini <alessandro@ghedini.me>2014-08-13 17:51:07 +0200
committerAlessandro Ghedini <alessandro@ghedini.me>2014-08-13 19:16:53 +0200
commite33df9b7bc6858ae1f2a5e0c14fe828fa73ddc31 (patch)
tree17bec828452a120ad6ecdbd4003819201f1728d6
parent6310bd60e64dff1d12c8d040ba8c87a11f72751b (diff)
downloadmpv-e33df9b7bc6858ae1f2a5e0c14fe828fa73ddc31.tar.bz2
mpv-e33df9b7bc6858ae1f2a5e0c14fe828fa73ddc31.tar.xz
vdpau: correctly mark invalid mixer as such on vdp_video_mixer_create() failure
Otherwise vdp_video_mixer_destroy() would later fail when called on an invalid video mixer handle. With mesa r600 vdpau driver, this would cause a segfault.
-rw-r--r--video/vdpau_mixer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/video/vdpau_mixer.c b/video/vdpau_mixer.c
index 88509ea833..1112cb0de3 100644
--- a/video/vdpau_mixer.c
+++ b/video/vdpau_mixer.c
@@ -170,6 +170,9 @@ static int create_vdp_mixer(struct mp_vdpau_mixer *mixer)
VDP_NUM_MIXER_PARAMETER,
parameters, parameter_values,
&mixer->video_mixer);
+ if (vdp_st != VDP_STATUS_OK)
+ mixer->video_mixer = VDP_INVALID_HANDLE;
+
CHECK_VDP_ERROR(mixer, "Error when calling vdp_video_mixer_create");
mixer->initialized = true;