From 3acf2eb56318b0c6cbdeb25b67154ae5e493e7d6 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Fri, 29 Oct 2010 18:38:22 +0300 Subject: vo_vdpau: add extra check for unknown image format Add a default case for unknown image format in create_vdp_decoder. I think this condition shouldn't currently happen, but it's worth a sanity check. Avoids a compiler warning about vdp_decoder_profile being possibly used uninitialized. Also remove an obsolete #ifdef (should always be true now). --- libvo/vo_vdpau.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libvo/vo_vdpau.c') diff --git a/libvo/vo_vdpau.c b/libvo/vo_vdpau.c index af4943ed1b..cff89e0844 100644 --- a/libvo/vo_vdpau.c +++ b/libvo/vo_vdpau.c @@ -742,17 +742,19 @@ static int create_vdp_decoder(struct vo *vo, int max_refs) case IMGFMT_VDPAU_VC1: vdp_decoder_profile = VDP_DECODER_PROFILE_VC1_ADVANCED; break; -#ifdef VDP_DECODER_PROFILE_MPEG4_PART2_ASP case IMGFMT_VDPAU_MPEG4: vdp_decoder_profile = VDP_DECODER_PROFILE_MPEG4_PART2_ASP; break; -#endif + default: + mp_msg(MSGT_VO, MSGL_ERR, "[vdpau] Unknown image format!\n"); + goto fail; } vdp_st = vdp->decoder_create(vc->vdp_device, vdp_decoder_profile, vc->vid_width, vc->vid_height, max_refs, &vc->decoder); CHECK_ST_WARNING("Failed creating VDPAU decoder"); if (vdp_st != VDP_STATUS_OK) { + fail: vc->decoder = VDP_INVALID_HANDLE; vc->decoder_max_refs = 0; return 0; -- cgit v1.2.3