Camera app crash.

So yesterday I was down at the beach taking photos of my little one. Anyway I'm using pro mode and 50mp. So a few photos in phone is working fine. After about 5mins of use I notice that the shutter button isn't working. I press it, the button presses but no photo is taken. I continue pressing still nothing. Then it will take a photo, followed by an app crash warning. App shuts down. I open camera app and its working fine again. This happened a few times yesterday.