Masterbating

If I masturbate with my legs crossed and "push" like rub my legs together on someone else's bed and if they had sex with someone on the bed and I mssturbate how I already said on the bed naked could I get any stds if they had any?