A merged CBS-Viacom would put Viacom CEO Bob Bakish at the head of the table, according to reports.

CBS acting CEO Joe Ianniello would be offered a job overseeing all of the combined network’s branded assets, the Wall Street Journal reported.

The two media companies, which are controlled by Sumner Redstone’s National Amusements, hammered out the leadership plan because the question of who will lead threatened to stand in the way of a deal, WSJ said.

Bakish’s elevation to CEO was widely expected by media watchers because he is the presumed favorite of National Amusements heiress Shari Redstone, who is vice chair of both CBS and Viacom.

Ianniello’s future role with the company had been a bigger mystery.

The dynamic exec had been a loyal lieutenant of former chairman and CEO Les Moonves, who stepped down amid sexual misconduct allegations.

Last summer, Ianniello’s future at the company was put in doubt when a slew of text messages emerged showing Ianniello supporting Moonves’ battle to dilute Redstone’s voting control over the media company.

Sources told The Post that since Ianniello was elevated to acting CEO of CBS last fall, Redstone has warmed up to him despite their rocky past.

Christina Spade, the chief financial officer of CBS, would become chief financial officer, WSJ reported.

CBS declined to comment.