vd_lavc: don't crash if codec could not be opened

Fixes #1307.