In the Pacific Northwest (US & Canada) native Americans who lived on a diet containing a lot of fish and local game, did take small fish (smelt, herring etc.) and let them rot in a cedar box full of water. They would then scoop the fish oil that floated to the surface and use that in cooking and to augment their diet.
So not all rotted food needs to be eaten for maggots and fly larva.
Garum was the Roman equivalent to what these native americans did.
Look up Roman Garum or Vietnamese Fish Sauce.