The vulnerability is a heap buffer underwrite within the Floyd-Steinberg dithering implementation in ImageMagick. The root cause was identified by analyzing the commit 017c7efe4d63b953b35ab96fc0939ba3620e4739, which is explicitly linked to the security advisory GHSA-2hhq-c99x-492r. The patch modifies the FloydSteinbergImageDepth function in MagickCore/attribute.c. The change involves adding index increments (u++ and v++) before a continue statement. This is necessary when skipping pixels that are masked out. In the vulnerable version, failing to increment these indices meant that on a subsequent iteration, the program would write to a stale, out-of-bounds location in the distortion heap buffer, causing memory corruption. The identified vulnerable function, FloydSteinbergImageDepth, is the exact location of the flawed logic and would be present in any runtime profile when triggering this vulnerability.