so i've started lifting a month ago or so, when doing shoulder press my right shoulder hurts, like I need to stop right away, and then the pain goes away as soon as I stop.

The pain is situated on the part from the bicept to the shoulder, its not sharp but its pain, the teacher at the gym changed my plan and told me its probably because of my horrible postured and rounded shoulders, he gave me some posture exercises aswell.

any tips on this? is it injury? or is it something that happens when you got fucked up posture?