With regard to written texts, a Torah is invalidated if the same character is written for what should be distinct letters (e.g. כ and ב). However, with regard to the spoken language and people who are unable to pronounce a letter correctly, the Midrash (Shir HaShirim Rabba parsha 2, on Shir HaShirim 2:4 [hattip @DoubleAA]) interprets the verse "ודגלו עלי אהבה" to say that G-d counts their intent, not their spoken words (the case used in the derash is the extreme example where one read "ואהבת" ["and thou shall love"] as "ואיבת" ["and thou shall hate"]).
If, however, someone is able to pronounce the sounds correctly but was taught by their teachers the wrong pronunciation, and never bothered updating his pronunciation even after finding out the error, is his mispronunciation halachically valid (e.g. for kriyat shema, parshat amalek, tefilla, etc.)?