The vulnerability is a denial of service in the jsPDF library, caused by uncontrolled resource allocation when processing GIF images. The root cause lies within the omggif.js library, specifically in the decodeAndBlitFrameBGRA and decodeAndBlitFrameRGBA functions of the GifReader. These functions would calculate the memory needed for a GIF frame based on its width and height as specified in the image headers. The vulnerability existed because there was no validation of these dimensions, allowing an attacker to craft a GIF with extremely large dimensions. When the addImage or html methods of jsPDF were used to process such a malicious GIF, these underlying functions would attempt to allocate an unreasonable amount of memory, leading to an out-of-memory error and crashing the application. The patch introduces a size check, throwing an error if the required memory exceeds 512MB, thus preventing the denial of service.