Bad advisor + a research area that interesets me or an active advisor + research topic that doesn't interest me?
I'm going to assume that by "bad reputation" that you don't mean that they actively impede and harass students. Avoid such advisors like the plague - which they are. The following only refers to situations in which "bad" means that they aren't very active in the field and are without much of a publication record. 

If you really can't move to a more compatible place, then ask yourself how self directed are you and how much drive do you have to get it done on your own? If you have an advisor in analysis (my original field, actually) who is a decent person who will respond to your questions and concerns, even while not providing a lot of guidance, then you could probably be successful. It would be good training, actually, for an academic career, which you eventually need to be able to carry on by yourself. But it would take a lot of reading to find a good problem. 

However, if you aren't that self directed and need a lot of guidance, then it might be best to choose an advisor from a related subfield if you can find one who will give you the external direction you need. It is a tradeoff, as are many things in life. 

But study for Master's degree isn't forever. A lot of it is coursework most places and it isn't usually necessary to specialize so completely that you can't still keep a bit of generality in your program. (Yes, there are places in which that isn't true and where specialization is all, but not everywhere.)

Another option, if you have a good, compatible advisor, is to also seek advice on some aspects of your study via the internet from authors who write in your field. International collaboration is feasible now where it wasn't in the past. 

My suggestion, then, is that the human qualities of an advisor, and a willingness to help you can be as important as an international reputation in the field. 

But when/if it comes time to study for a doctorate, pick a place where you get more support for your field. 



Note that this advice would be much less valuable for a doctoral advisor. There, the student probably needs more guidance.