diff options
author | Alessandro Ghedini <alessandro@ghedini.me> | 2014-08-13 17:51:07 +0200 |
---|---|---|
committer | Alessandro Ghedini <alessandro@ghedini.me> | 2014-08-13 17:57:19 +0200 |
commit | 2607d6e41997e4420894531c6f523c92e7e6d195 (patch) | |
tree | 2d99ff7ec85d5deb01b5ca388b1b0258d663439a /video/vdpau_mixer.c | |
parent | 69d5356d7664004c9329ca60f6ff29c3b5b296bf (diff) | |
download | mpv-2607d6e41997e4420894531c6f523c92e7e6d195.tar.bz2 mpv-2607d6e41997e4420894531c6f523c92e7e6d195.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.
Diffstat (limited to 'video/vdpau_mixer.c')
-rw-r--r-- | video/vdpau_mixer.c | 3 |
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; |