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.
This commit is contained in:
Alessandro Ghedini 2014-08-13 17:51:07 +02:00
parent 69d5356d76
commit 2607d6e419
1 changed files with 3 additions and 0 deletions

View File

@ -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;