All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
All items are pure in principle unless there is evidence that proves the impurity of a certain thing. There is no evidence that indicates that rotted fruits and vegetables are impure and therefore they are principally pure. If people find something disgusting, this does not mean that it is impure, such as the nasal mucus. Anas narrated that the Messenger of Allaah, sallallaahu ‘alayhi wa sallam, answered the invitation of a Jew who invited him to eat barley bread and rancid fat. [Al-Bukhari]
Commenting on the Hadeeth, Al-Haafith Ibn Hajar indicated that that meal consisted of fat which is cooked with such as oil, butter or grease. That meal had a changed color and smell because it was old and stale. This stands as evidence that food which has a change in color or smell is pure.
Narrating the story of the Battle of Al-Khandaq (the trench), Anas said: "People used to bring a handful of barley, and a meal would be prepared thereof by cooking it with rancid fat and it would be presented to the people (the Prophet and the Companions) who were hungry, and it would stick to their throats and had a nasty smell." [Al-Bukhari]
Allaah Knows best.