ImageMagick before 6.9.13-61 and 7.x before 7.1.2-36 contains a heap-based buffer overflow in the MAC image decoder, which writes past the end of a heap buffer when a specific decoding failure occurs. Attackers can supply a crafted MAC image to corrupt heap memory, causing a crash or other memory corruption.