In ImageMagick 7.0.8-40 Q16, there is a heap-based buffer over-read in the function WritePNMImage of coders/pnm.c, which allows an attacker to cause a denial of service or possibly information disclosure via a crafted image file. This is related to SetGrayscaleImage in MagickCore/quantize.c.
lists.opensuse.org/opensuse-security-announce/2019-06/msg00057.html
lists.opensuse.org/opensuse-security-announce/2019-07/msg00001.html
www.securityfocus.com/bid/108102
github.com/ImageMagick/ImageMagick/issues/1540
lists.debian.org/debian-lts-announce/2019/05/msg00015.html
lists.debian.org/debian-lts-announce/2020/09/msg00007.html
usn.ubuntu.com/4034-1/
www.debian.org/security/2020/dsa-4712