Yahoo CEO Marissa Mayer made $42 million last year. She could have made a whole lot more if Yahoo were doing well.

Mayer was docked $900,000 from her bonus and $12.4 million from her stock awards due to the company's less-than-stellar 2014 financial performance.

Yahoo's (YHOO) board sets performance goals for its executives every year, and how close they come to meeting those targets determines how much they get paid. The company's revenue only equaled 92% of the $5 billion performance target last year and adjusted profit only came in at 93% of the $1.5 billion Yahoo was hoping for.

That's why Mayer was only eligible for 55% of her $2 million target bonus (she ended up taking home $1.1 million). Also, Mayer only received 69% of a possible $40 million in stock awards (she took home $27.5 million worth of those options and grants).

If the company were performing well, Mayer would have made more than $55 million. She lost out on over $13 million in pay and stock compensation.

Still, Yahoo's board praised Mayer for her accomplishments.

"Ms. Mayer provided strong leadership overall to the company," the board said in a proxy statement, filed to the Securities and Exchange Commission this week. "She significantly improved the company's reputation and revitalized the company's employee base."

The board said that Mayer helped grow Yahoo's mobile revenue, sped up the pace of innovation at the company, and negotiated a deal to replace rival Google (GOOGL) as the default search engine on Firefox.

Even with the company's poor financial performance, Mayer's pay ended up being so high because of Yahoo's stellar stock performance since she took the company's reins in 2012. Yahoo's shares have tripled over the past three years -- mostly due to its giant stake in Alibaba (BABA). Had Yahoo's stock stayed flat, the company said Mayer would have earned $17.1 million in 2014.

Mayer negotiated into her contract several one-time stock options and signing bonuses that happened to pay out in 2014. That helped her earn 68% more in 2014 than she had earned in 2013. If she remains at Yahoo, she won't be eligible for such a sky-high payday every year.