In ImageMagick 7.0.7-17 Q16, there are memory leaks in ReadPATTERNImage in coders/pattern.c. https://nvd.nist.gov/vuln/detail/CVE-2018-5246