The vulnerability, identified as GHSA-5vx3-wx4q-6cj8, is a NULL pointer dereference in the Magick Scripting Language (MSL) parser of ImageMagick. The root cause lies within the MSLEndElement function in coders/msl.c. This function processes the closing tags of MSL elements. Specifically, when handling the </comment> and </label> end tags, the code calls DeleteImageProperty on an image object, msl_info->image[n]. The vulnerability arises because the code does not verify that this image object is non-NULL before the call. An attacker can craft an MSL file where a <comment> or <label> tag appears before any image is loaded via a <read> tag. In this scenario, msl_info->image[n] is NULL, and the subsequent call to DeleteImageProperty results in a NULL pointer dereference, crashing the application. The patch for this vulnerability introduces a check to ensure msl_info->image[n] is not NULL before calling DeleteImageProperty, thus mitigating the denial-of-service risk.