Virus can infects CD or DVD only when we are going to write some information into that CD or DVD. Virus can not infect CD or DVD when we are going to read the information in that.
That being said, depending on the virus, if the virus was also burned in the CD, it is possible that it may be dormant in the CD until, it is executed onto computer and then it may start running.
:ranger: