h264: improve behaviour with invalid reference lists