Hypothetically speaking say you've been stuck in a room for weeks with no way out and rescue will not be there by the time you starve to death... unless you eat the remaining of a preserved human body lying in the middle of the room. By eating the human body, you stall the time till rescue gets here, if they get here. If you don't you will die from starvation before rescue comes. You have access to water so we can exclude that as an issue.
What if you aren't sure whether rescue might come? Would you prolong it even then?
What would you do? Would you consider cannibalism to fight for your life?