A regression was introduced in Pillow due to the fix for CVE-2026-112402, causing failures when resizing images with the NEAREST filter and resizing images in '1' or 'P' mode. The original vulnerability (CVE-2026-112402) involves a double free of image memory when ImagingScaleAffine encounters a selective allocation failure, potentially leading to a crash. Multiple other vulnerabilities affecting Pillow were also fixed in the same update. This regression has been corrected in subsequent updates.