Disney is lining up financing in case Twenty-First Century Fox's board demands cash, sources told CNBC.

Disney is prepared to offer significant cash if needed, the sources said. The two are in agreement on a $52.4 billion bid for Disney to buy Fox's movie studio and other assets. But Disney is competing with a potential bid by Comcast, the parent of CNBC.

Comcast is expected to make a bid if a federal judge rules in favor of AT&T in a trial over its merger with Time Warner. Its offer is expected to top Disney's and be in all cash. Disney is preparing to counteract in the event Fox's board decides it wants cash as part of Disney's deal, which currently is all stock.