ThorVG heap buffer overflow in jpgd JPEG scan decoding
thorvg
thorvg
| Product | Affected | Fixed in |
|---|---|---|
| thorvg thorvg |
| No fix yet |
Thor Vector Graphics (ThorVG) is a production-ready vector graphics engine. Prior to 1.1.2, the bundled jpgd JPEG decoder accepts duplicate component selectors in an SOS scan header, causing each duplicate to increase m_blocks_per_mcu without checking the buffers sized from the frame components. A crafted grayscale JPEG can repeat its component in the SOS header, causing decode paths in src/loaders/jpg/tvgJpgd.cpp to write beyond heap buffers sized for one component. The issue is reachable through direct JPEG decoding and through JPEG images embedded in Lottie content, and confirmed impact is memory corruption followed by a process crash. This issue is fixed in version 1.1.2.
From the CVE record · GitHub_M
Before version 1.1.2, ThorVG's bundled jpgd decoder mishandles duplicate component selectors in a JPEG scan header. Processing a crafted grayscale JPEG, either directly or embedded in Lottie content, can write beyond heap buffers, causing memory corruption and a process crash.
Engineers running ThorVG versions prior to 1.1.2 should check their deployments.