The 2009 movie Jamie Foxx thought about walking away from: “I was in a bad place”