The image of an extended object, placed perpendicular to the principal axis of a mirror, will be erect if

the erect image of the object can be formed either when the real object is kept in front of mirror at appropriate distance which gives the image beyond the mirror referring that image will be virtual. Or, when the virtual object forms a real image. This can be seen in our daily life activities like when we look at mirror, our image forming in the mirror becomes virtual object for our eyes and our real image is formed on the retina of our eyes. The image formed in this process is real and erect. Therefore, only in these two cases we can get erect images.

Hence, option C and D are correct.