Is marrying your cousin actually dangerous?

Is marrying and mating with your cousins really that bad? After all, brilliant minds like Albert Einstein and Charles Darwin did it. The odds of passing a genetic disease to your offspring can be higher with your cousin, but it depends on what's hiding in your family tree to begin with.