Offence
A player in an offside position is only penalised if, at the moment the ball touches or is played by one of his team, he is, in the opinion of the referee, involved in active play by:
interfering with play or
interfering with an opponent or
gaining an advantage by being in that position
No offence
There is no offside offence if a player receives the ball directly from:
a goal kick
a throw-in
a corner kick
Infringements and sanctions
In the event of an offside offence, the referee awards an indirect free kick to the opposing team to be taken from the place where the infringement occurred (see Law 13 - Position of free kick).
No mention of being played on by an opponent and he did gain an advantage by being in that position.
Read more at
http://www.thefa.com/football-rules-...jFXCrrQHa7a.99