On the other hand, let's assume that the project is indeed doomed and that you decide to stay for the next seven months. You are clearly not responsible for the success or failure of the project [1]. Perhaps you might be able to get something positive out of the experience (apart from the pile of money, obviously) if you look at things in another way. Some ideas:
* are there useful things you can still learn from this workplace / project / your fellow co-workers? (if so, getting paid good money to learn is a pretty good deal!)
* is there an opportunity to push for some kind of development process improvement / large-scale refactoring on such a large, troubled codebase, to make things incrementally better? (this experience could be quite valuable)
* do you have ownership of / responsibility for some smaller thing that could potentially make a good item on your resume?
* can you move sideways within the firm to another project?
* are there other ways that you can contribute, aside from toward the project? e.g. instead of focusing on helping the project, can you instead focus on helping your coworkers?
* work your hours, do it for the money, instead focus on improving and enjoying the non-work aspects of your life [2].
[1][2] i am projecting: i suggest it is healthy not to tie your self-worth to the project you are working on. you probably don't do this anyhow!