One of the known issues for HTC One M8 is that the camera crashes in portrait mode. Though users have not particularly found it to be a problem in the landscape mode, the crashing becomes evident when the phone is tilted to the portrait mode. Here is the way to resolve the issue and prevent HTC One M8 camera crash.
LastPass, a popular password manager app in the phone has been linked to the camera crash on the HTC phone. But you do not need to delete the app or use another one, a basic edit can do fine. Login to the LastPass app, go to Preferences – Edit App Associations – Select ‘Camera’ and change the selection to ‘Do not show fill window’.