The Andhra Pradesh High Court on Tuesday granted anticipatory bail to film director Ram Gopal Varma in a case involving allegations that he posted objectionable messages on social media about Chief Minister N Chandrababu Naidu in the run-up to the 2024 general elections.