Coverty fixes

A set of coverty fixes attributed to dvdplayer. There still remain a few in VDPAU.