It is narrated from Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) that Abd al-Rahman bin Abi Hurayrah asked him about the many fish which the sea throws out (onto the shore). Sayyiduna Ibn Umar (may Allah be pleased with them both) asked: "Are they dead?" He said: "Yes." So he stopped him (from eating them). Nafi' (may Allah have mercy on him) reports: Then, when Sayyiduna Ibn Umar (may Allah be pleased with them both) came home, he called for the copy of the Qur'an and recited this verse: "Lawful to you is the game of the sea and its food, as provision for you." (Then he said:) "So the food of the sea is whatever comes out of it; therefore eat it, there is no harm in it. And everything in it may be eaten, whether it dies inside it or (is found dead) on its shores." Imam al-Bayhaqi recorded this incident in his Sunan in these words: Abd al-Rahman bin Abi Hurayrah asked Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) about what the sea casts out, and he forbade him from eating it. Nafi' (may Allah have mercy on him) said: Then Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) turned back, called for the copy of the Qur'an and recited this verse: "Lawful to you is the game of the sea and its food." Then Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) sent word to Abd al-Rahman bin Abi Hurayrah: "There is no harm in eating it, so eat it."
It is narrated from Abu Matar: "I came out of the mosque and suddenly a man called out behind me. I asked: Who is this? The people said: This is Sayyiduna Ali (may Allah be pleased with him). Then I walked behind him until he came to the fish sellers and said: 'Let no fish that has (died and) floated to the surface of the water be sold in our market.'" This chain is da'if (weak) because its narrator Abu Matar is majhul (unknown), as Imam Abu Hatim said.