(a)
Notwithstanding any provision of law or of any local ordinance to the contrary, when any firearm is in the possession of any officer of the state, or of a county, city, or city and county, or of any campus of the University of California or the California State University, and the firearm is an exhibit filed in any criminal action or proceeding which is no longer needed or is unclaimed or abandoned property, which has been in the possession of the officer for at least 180 days, the firearm shall be sold, or destroyed, as provided for in Sections 18000 and 18005.
(b)
This section does not apply to any firearm in the possession of the Department of Fish and Game, or which was used in the
violation of any provision in the Fish and Game Code, or any regulation under that code.