Description
psd-tools is a Python package for working with Adobe Photoshop PSD files. Prior to version 1.12.2, when a PSD file contains malformed RLE-compressed image data (e.g. a literal run that extends past the expected row size), decode_rle() raises ValueError which propagated all the way to the user, crashing psd.composite() and psd-tools export. decompress() already had a fallback that replaces failed channels with black pixels when result is None, but it never triggered because the ValueError from decode_rle() was not caught. The fix in version 1.12.2 wraps the decode_rle() call in a try/except so the existing fallback handles the error gracefully.
Problem types
CWE-409: Improper Handling of Highly Compressed Data (Data Amplification)
CWE-789: Memory Allocation with Excessive Size Value
CWE-190: Integer Overflow or Wraparound
CWE-755: Improper Handling of Exceptional Conditions
CWE-704: Incorrect Type Conversion or Cast
Product status
References
github.com/...-tools/security/advisories/GHSA-24p2-j2jr-386w
github.com/...ommit/6c0a78f195b5942757886a1863793fd5946c1fb1
github.com/psd-tools/psd-tools/releases/tag/v1.12.2