A person who is peacefully protesting has no legal connection to anyone who is protesting violently, but from a practical viewpoint, anyone in a crowd in which violence is occurring may suffer from whatever enforcement actions are used against the violent protesters. As we've seen time and again, when violent people and the authorities clash, peaceful people get caught up in the violence simply because they may be near the violence.
Even if one argues that a peaceful member of a crowd has a responsibility to act against violence, that act is usually violent by its nature and adds to the overall violence. If a peaceful crowd action devolves into violence, the only practical solution is for the peaceful participants to leave the area. Most sociologists who study crowds conclude that many crowds begin to exhibit the characteristics of the worst-behaving member of the crowd, and if that behavior becomes dominant, there is no longer a chance for peaceful protest anyway.