I will give u some simple steps to recover from it
Step :1
Try hard reset(press both powerbutton and homebutton for 5 seconds till apple logo comes)mostely by doing this glitch will go off. then open the camera app .it should work fine
Step:2
Try to restore with itunes if u have ipsw file in the computer ,connect your phone to computer and open itunes on the rightside restore tab is available if you are using windows hold shift key and locate the ipsw file on your pc else if you were on mac hold alt key and locate the file ,after locating put your phone on dfu mode (if u dont know what is dfu mode just google it) and restore it
Step3: still you are not getting the camera work try to download the ipsw file form other custom sites
Go to-- iphonefirmware.com and download the respective file from it and try to restore with this file
Reasons which i know about this camera problem:
I think it may b problem with the software
There may be problem in the springboard. But im not sure about this because in my iphone 4 some times camera works absolutely fine ,for a month it works fine but now again the problem starts (it strucks ) freezes
Feel free to comment guys your comments are welcome here
You can give your commends here ;) thank you