With the DEFLATE compression used by the PNG image format one can compress a 50 gigapixel image to a 6 Mb PNG file. When decoding such a file, png.Decode throws a fatal error: runtime: out of memory.
image/png should provide a safety switch that allows the user to limit the amount of memory that png.Decode will use.
Test case: https://github.com/opennota/spark
Reference: https://www.bamsoftware.com/hacks/deflate.html