A Lesson from the Deluge
Answer: A similar question was put to Rabbi Yitzchak Zilberstein by someone who had already surrendered to such temptation and asked whether he had acted in a proper fashion.
His response was that as long as the produce belonged to someone who, for marketing considerations, insisted on its destruction, it was illegal for anyone to avail himself of it. As support for labeling such action theft he cited the Midrash about G-d commanding Noach to avoid stealing from anyone in order to provide for his family and all the animals a year's supply of food while they were in the ark. Although Noach realized that all of this food — and its owners — would in any case be destroyed in the deluge, he refrained from stocking up with anything that he had not purchased.