Let's be honest and say that Brazil doesn't have the greatest repuation for safety. Add the ready availability of firearms to a country with extreme income inequality, restricted access to education, health care and other social infrastructure for low socio-economic groups, racial discrimination, high youth unemployment, government and judicial corruption as well as a flourishing drug trade and you can see you have a pretty good chance of developing rather healthy crime rate.
I'm guessing this section is likely to be well read. Fear of what might happen should not put you off going to Brazil. Yes there is risk but there is also reward. In this section,
The picture ain't pretty but the real risk to independent travellers (and even rich travellers) is probably a lot less than the perception of risk. Those most at risk of violent crime in Brazil (and America too for that matter) are poor, black, young and male. The crime rate between poor neighbourhoods (where you rarely find tourists) and rich neighbourhoods (where you are more likely to find tourists) can be stark. Example:
The rise in the murder rate is not even – it is concentrated in areas of greater socio-economic exclusion and reduced police presence (see maps in appendix 2) as well as among specific social groups. In the city of São Paulo, Jardim Ângela, a socially deprived district in the south of the city, suffered 309 homicides or 123 per 100,000 in 2001, while the middle class district of Moema, only a few kilometres away, suffered 2 homicides or 3 per 100,000 in the same year....
Black youths, in particular, are at risk. According to UNESCOs study on violence in Brazil, there are approximately the same number of white youths as black youths, around 16 million. Yet, black youths suffer double the number of homicides. Of the 17,900 youths who were victims of homicides in 2002, 11,308 were black while 6,592 were white (30)...."
The quotes come from Amnesty International's 2005 report "They come in shooting": Policing socially excluded communities. The number in brackets ( ) is a quotation within the article from UNESCO's 2004 report, Mapa da Violência IV: os Jovens do Brasil.