The milk is off.
The milk has turned. (referring to 'turning sour')
The cake is stale.
'rotten' implies a state of decay, and we would talk about eggs being rotten if when cracked, they smell foul (giving off "rotten egg gas"); and foods showing signs somewhere between having fungus growing on them, to when maggots are present!