A guy friend rubbing my inner thigh?

We were hanging out with some childhood friends watching a scary movie and I sat by my guy friend. Soon through the movie I noticed he was rubbing my thigh (it wasn't that weird because we were under a blanket so, no one noticed) it was really subtle at first and then he started rubbing it and moved up and down on it. When one of our friends started talking to him he quickly let go of my leg, but later put his hand back. I didn’t mind, but I just don’t understand why he did it. Any ideas?
A guy friend rubbing my inner thigh?
Post Opinion